19626
2023-10-07 988f9735377909b6310301e582c15804e004783f
近期修改cjw
46个文件已添加
139个文件已修改
10062 ■■■■ 已修改文件
force-app/main/default/aura/ImprovedForecastTime/ImprovedForecastTime.auradoc 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/ImprovedForecastTime/ImprovedForecastTime.cmp 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/ImprovedForecastTime/ImprovedForecastTime.cmp-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/ImprovedForecastTime/ImprovedForecastTime.css 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/ImprovedForecastTime/ImprovedForecastTime.design 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/ImprovedForecastTime/ImprovedForecastTime.svg 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/ImprovedForecastTime/ImprovedForecastTimeController.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/ImprovedForecastTime/ImprovedForecastTimeHelper.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/ImprovedForecastTime/ImprovedForecastTimeRenderer.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/improvedForecastTimeAura/improvedForecastTimeAura.auradoc 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/improvedForecastTimeAura/improvedForecastTimeAura.cmp 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/improvedForecastTimeAura/improvedForecastTimeAura.cmp-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/improvedForecastTimeAura/improvedForecastTimeAura.css 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/improvedForecastTimeAura/improvedForecastTimeAura.design 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/improvedForecastTimeAura/improvedForecastTimeAura.svg 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/improvedForecastTimeAura/improvedForecastTimeAuraController.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/improvedForecastTimeAura/improvedForecastTimeAuraHelper.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/improvedForecastTimeAura/improvedForecastTimeAuraRenderer.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/taskManage/taskManage.cmp 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/taskManage/taskManage.css 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/taskManage/taskManageController.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/taskManage/taskManageHelper.js 92 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/AccountDelayApplyHandler.cls 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/ApprovalHistoryController.cls 533 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/ApprovalHistoryController.cls-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/ApprovalHistoryUtil.cls 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/ApprovalHistoryUtil.cls-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/AssetMaintainController.cls 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/FixtureRentalPDFController.cls 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/InquiryFormHandler.cls 211 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LostCancelReportHandler.cls 163 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LostCancelReportHandlerTest.cls 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LostCancelReportOppBatchTest.cls 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/MaintenanceProductDataController.cls 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/OpportunityLightingButtonController.cls 127 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/PCLLostReportController.cls 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/Product2Handler.cls 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/RentalApplyFaultHandler.cls 569 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/RentalApplyFaultHandler.cls-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/ReportController.cls 377 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/ReportControllerTest.cls 286 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/StaticParameter.cls 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/StaticParameter.cls-meta.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/UpdateContractAimAmountHandler.cls 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/lexPCLLostReportLwcController.cls 209 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/approvalHistoryLWC/ApprovalHistoryLWC.css 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/approvalHistoryLWC/approvalHistoryLWC.html 200 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/approvalHistoryLWC/approvalHistoryLWC.js 859 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/approvalHistoryLWC/approvalHistoryLWC.js-meta.xml 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/approvalHistoryLWC/approvalHistoryUtil.js 264 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/approvalLookUp/approvalLookUp.css 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/approvalLookUp/approvalLookUp.html 189 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/approvalLookUp/approvalLookUp.js 326 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/approvalLookUp/approvalLookUp.js-meta.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.css 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.html 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.js 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.js-meta.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexASACEditor/lexASACEditor.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.css 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.html 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.js 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexApplyAgainLwc/lexApplyAgainLwc.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexAssignTaskButton/lexAssignTaskButton.js 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.css 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.css 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCBLBPNewLwc/lexCBLBPNewLwc.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCancel/lexCancel.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCancelReport/lexCancelReport.css 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCancelReport/lexCancelReport.html 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCancelReport/lexCancelReport.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexChangeContractType/lexChangeContractType.css 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexChangeContractType/lexChangeContractType.html 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexChangeContractType/lexChangeContractType.js 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCopyWithAsset/lexCopyWithAsset.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCopyWithAsset/lexCopyWithAsset.js 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCreateActivity/lexCreateActivity.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCreateActivity/lexCreateActivity.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.html 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexDispatchOCSMQARA/lexDispatchOCSMQARA.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexEditCancelReport/lexEditCancelReport.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexEditLost/lexEditLost.js 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexEnquiryNoBidding/lexEnquiryNoBidding.html 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexImprovedForecastTimeNew/__tests__/lexImprovedForecastTimeNew.test.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexImprovedForecastTimeNew/lexImprovedForecastTimeNew.html 135 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexImprovedForecastTimeNew/lexImprovedForecastTimeNew.js 290 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexImprovedForecastTimeNew/lexImprovedForecastTimeNew.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexLookupLwc/lexLookupLwc.html 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexLookupLwc/lexLookupLwc.js 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexLoseBid/lexLoseBid.css 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexLoseBid/lexLoseBid.html 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexLoseBid/lexLoseBid.js 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexLoseReport/lexLoseReport.css 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexLoseReport/lexLoseReport.html 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexLoseReport/lexLoseReport.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewOpportunityAgency/lexNewOpportunityAgency.css 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewOpportunityAgency/lexNewOpportunityAgency.html 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewOpportunityAgency/lexNewOpportunityAgency.js 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewOpportunityFile/lexNewOpportunityFile.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewSolutionClosingAttachment/lexNewSolutionClosingAttachment.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewSolutionProgramma/lexNewSolutionProgramma.js 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewSolutonProLwc/lexNewSolutonProLwc.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMNoToReportForReport/lexOCSMNoToReportForReport.js 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMToReport/lexOCSMToReport.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.css 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.html 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.js 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOPDReport/lexOPDReport.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOPDReportConsum/lexOPDReportConsum.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOpporSplite/lexOpporSplite.html 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOpporSplite/lexOpporSplite.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.css 177 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.html 405 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.js 312 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.css 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.html 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.js 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexQuotationProductNew/lexQuotationProductNew.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexQuotationRequest/lexQuotationRequest.css 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexQuotationRequest/lexQuotationRequest.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexQuotationRequest/lexQuotationRequest.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexRequestDB/lexRequestDB.css 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexRequestDB/lexRequestDB.html 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexRequestDB/lexRequestDB.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSIStoOPD/lexSIStoOPD.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSpecSubmit/lexSpecSubmit.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexStockApply/lexStockApply.css 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexStockApply/lexStockApply.html 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexStockApply/lexStockApply.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSubmitCompetitorReport/lexSubmitCompetitorReport.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSubmitReport/lexSubmitReport.css 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSubmitReport/lexSubmitReport.html 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSubmitReport/lexSubmitReport.js 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexVOCAnswer/lexVOCAnswer.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexVOCFinish/lexVOCFinish.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexVOCSubmit/lexVOCSubmit.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/modal/modal.css 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/modal/modal.html 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/modal/modal.js 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/modal/modal.js-meta.xml 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/multiSelectCombobox/multiSelectCombobox.html 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/multiSelectCombobox/multiSelectCombobox.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/tEnquiry/tEnquiry.html 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/tEnquiry/tEnquiry.js 101 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/AssetMaintain.page 185 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/AssetMaintainDetail.page 117 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/AssetMaintainIframe.page 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/CheckAllOlympusAsset.page 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/ConsumApplyBR.page 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/DiscountProductApplication.page 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/Enquiry.page 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/ImprovedForecastTime.page 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/ImprovedForecastTimeAno.page 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/InventoryReport.page 228 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/LostEditPage1.page 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/LostViewPage1.page 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/MaintenanceProductData.page 184 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/MergeAgencyActivity.page 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/OFSInsReportLayoutgzw.page 789 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/OFSInsReportLayoutgzw.page-meta.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/PCLLostReportPageLwc.page 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/searchAimsAccount.page 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/taskManage.page 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/staticresources/blockUIcss.css 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/triggers/AttachmentTrigger.trigger 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/triggers/ContentDocumentLink.trigger 202 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/triggers/ContentDocumentTrigger.trigger 283 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/triggers/ContentVersionTrigger.trigger 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/triggers/RentalApplyFaultTrigger.trigger 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/triggers/RentalApplyFaultTrigger.trigger-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/ImprovedForecastTime/ImprovedForecastTime.auradoc
New file
@@ -0,0 +1,6 @@
<aura:documentation>
    <aura:description>Documentation</aura:description>
    <aura:example name="ExampleName" ref="exampleComponentName" label="Label">
        Example Description
    </aura:example>
</aura:documentation>
force-app/main/default/aura/ImprovedForecastTime/ImprovedForecastTime.cmp
New file
@@ -0,0 +1,11 @@
<!--
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-09-22 17:41:57
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-22 18:37:18
-->
<aura:component>
</aura:component>
force-app/main/default/aura/ImprovedForecastTime/ImprovedForecastTime.cmp-meta.xml
New file
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>58.0</apiVersion>
    <description>A Lightning Component Bundle</description>
</AuraDefinitionBundle>
force-app/main/default/aura/ImprovedForecastTime/ImprovedForecastTime.css
New file
@@ -0,0 +1,2 @@
.THIS {
}
force-app/main/default/aura/ImprovedForecastTime/ImprovedForecastTime.design
New file
@@ -0,0 +1,3 @@
<design:component >
</design:component>
force-app/main/default/aura/ImprovedForecastTime/ImprovedForecastTime.svg
New file
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E" />
        <path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF" />
    </g>
</svg>
force-app/main/default/aura/ImprovedForecastTime/ImprovedForecastTimeController.js
New file
@@ -0,0 +1,5 @@
({
    myAction : function(component, event, helper) {
    }
})
force-app/main/default/aura/ImprovedForecastTime/ImprovedForecastTimeHelper.js
New file
@@ -0,0 +1,5 @@
({
    helperMethod : function() {
    }
})
force-app/main/default/aura/ImprovedForecastTime/ImprovedForecastTimeRenderer.js
New file
@@ -0,0 +1,5 @@
({
// Your renderer method overrides go here
})
force-app/main/default/aura/improvedForecastTimeAura/improvedForecastTimeAura.auradoc
New file
@@ -0,0 +1,6 @@
<aura:documentation>
    <aura:description>Documentation</aura:description>
    <aura:example name="ExampleName" ref="exampleComponentName" label="Label">
        Example Description
    </aura:example>
</aura:documentation>
force-app/main/default/aura/improvedForecastTimeAura/improvedForecastTimeAura.cmp
New file
@@ -0,0 +1,12 @@
<!--
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-09-22 17:45:23
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-23 11:13:38
-->
<aura:component access="global" implements="force:lightningQuickActionWithoutHeader,force:hasRecordId,lightning:isUrlAddressable">
    <!-- <aura:attribute name="recordId" type="String" />
    <c:improvedForecastTime record-id="{!v.recordId}"></c:improvedForecastTime> -->
</aura:component>
force-app/main/default/aura/improvedForecastTimeAura/improvedForecastTimeAura.cmp-meta.xml
New file
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>58.0</apiVersion>
    <description>A Lightning Component Bundle</description>
</AuraDefinitionBundle>
force-app/main/default/aura/improvedForecastTimeAura/improvedForecastTimeAura.css
New file
@@ -0,0 +1,2 @@
.THIS {
}
force-app/main/default/aura/improvedForecastTimeAura/improvedForecastTimeAura.design
New file
@@ -0,0 +1,3 @@
<design:component >
</design:component>
force-app/main/default/aura/improvedForecastTimeAura/improvedForecastTimeAura.svg
New file
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E" />
        <path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF" />
    </g>
</svg>
force-app/main/default/aura/improvedForecastTimeAura/improvedForecastTimeAuraController.js
New file
@@ -0,0 +1,5 @@
({
    myAction : function(component, event, helper) {
    }
})
force-app/main/default/aura/improvedForecastTimeAura/improvedForecastTimeAuraHelper.js
New file
@@ -0,0 +1,5 @@
({
    helperMethod : function() {
    }
})
force-app/main/default/aura/improvedForecastTimeAura/improvedForecastTimeAuraRenderer.js
New file
@@ -0,0 +1,5 @@
({
// Your renderer method overrides go here
})
force-app/main/default/aura/taskManage/taskManage.cmp
@@ -1,7 +1,7 @@
<aura:component implements="force:appHostable,lightning:isUrlAddressable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes"
controller="taskManageController" >
        <aura:attribute name="opportunity_cfilter" type="String" default="" />
        <ltng:require styles="{!$Resource.lwcCSS}" />
    <aura:attribute name="selectedData" type="Object[]" />
    <aura:attribute name="data" type="Object[]" />
    <aura:attribute name="dataCopy" type="Object[]" />
@@ -97,19 +97,19 @@
    <aura:attribute name="estimatedFinishDate" type="Date" />
    <aura:handler name="init" value="{! this }" action="{! c.init }"/>
    <div>
        <lightning:spinner aura:id="mySpinner" size="large" class="slds-hide"/>
    </div>
    <div   style="margin-top:20px;   ">
            <lightning:spinner aura:id="mySpinner" size="large" class="slds-hide spinner-overlay"/>
        <lightning:accordion
                             allowMultipleSectionsOpen="true"
                             activeSectionName="{! v.activeSections }"
                             >
            <lightning:accordionSection name="A" label="自己的任务">
                <div class="c-container">
                    <lightning:layout multipleRows="true">
                <div class="c-container" style="width:1150px">
                    <lightning:layout multipleRows="true" >
                        
                        <lightning:layoutItem size="12" smallDeviceSize="6" mediumDeviceSize="4" largeDeviceSize="3" padding="horizontal_small">
                            <p class="slds-p-horizontal_small">
@@ -142,9 +142,10 @@
                        <lightning:layoutItem size="12" smallDeviceSize="6" mediumDeviceSize="4" largeDeviceSize="3" padding="horizontal_small">
                            <p class="slds-p-horizontal_small">
                                客户:
                                 <c:strike_lookup label="客户:"
                            <p class="slds-p-horizontal_small no-wrap" style="white-space: nowrap;">
                                <label style="padding-top: 9px;color: #747474; ">客户</label>
                                <div style="width: 200px;float: right;padding-top: 4px;">
                                    <c:strike_lookup label="客户:"
                                    object="Account"
                                    searchField="Name"
                                    placeholder="搜索客户..."
@@ -157,9 +158,10 @@
                                    allowNewRecords = "false"
                                    overrideNewEvent = "true"
                                    showRecentRecords ="true"
                                    value="{!v.myTempTask.account__c}"
                                    value="{!v.myTempTask.account__c}"
                                    subTitleFormat="{0}+{1}"/>
                                </div>
                            </p>
                        </lightning:layoutItem>
@@ -195,9 +197,12 @@
                        <lightning:layoutItem size="12" smallDeviceSize="6" mediumDeviceSize="4" largeDeviceSize="3" padding="horizontal_small">
                            <p class="slds-p-horizontal_small">
                                <lightning:button label="确认" iconName="utility:search"
                                iconPosition="left"
                                onclick="{! c.myTaskSearch }" />
                                <div style="float: right;">
                                    <lightning:button label="确认" iconName="utility:search"
                                    iconPosition="left"
                                    onclick="{! c.myTaskSearch }" />
                                </div>
                            </p>
                        </lightning:layoutItem>
@@ -222,7 +227,7 @@
                </div>
            </lightning:accordionSection>
            <lightning:accordionSection name="B" label="下属的任务">
                <div class="c-container">
                <div class="c-container" style="width: 1150px;">
                    <lightning:layout multipleRows="true">
                        <lightning:layoutItem size="12" smallDeviceSize="6" mediumDeviceSize="4" largeDeviceSize="3" padding="horizontal_small">
@@ -257,8 +262,9 @@
                        <lightning:layoutItem size="12" smallDeviceSize="6" mediumDeviceSize="4" largeDeviceSize="3" padding="horizontal_small">
                            <p class="slds-p-horizontal_small">
                                客户:
                               <c:strike_lookup label="客户:"
                                <label style="padding-top: 9px;color: #747474;">客户</label>
                                <div  style="width: 200px;float: right;padding-top: 4px;">
                                    <c:strike_lookup label="客户:"
                                    object="Account"
                                    searchField="Name"
                                    placeholder="搜索客户..."
@@ -273,6 +279,8 @@
                                    showRecentRecords ="true"
                                    value="{!v.subTempTask.account__c}"
                                    subTitleFormat="{0}+{1}"/>
                                </div>
                            </p>
                        </lightning:layoutItem>
                        <!--2021-09-28  mzy 任务管理改善 start-->
@@ -344,35 +352,41 @@
            </lightning:accordionSection>
            <div class="slds-modal slds-fade-in-open slds-hide" aura:id="successDiv">
                <ui:inputText aura:id="articleURL"/>
                <!-- <ui:inputText aura:id="articleURL"/> -->
                <div class="demo-only" style="height: 8rem;">
                    <div class="slds-notify_container slds-is-relative">
                        <div class="slds-notify slds-notify_toast slds-theme_success" role="alert">
                            <div class=" slds-m-left_xx-large">
                                <div class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large">
                            <div>
                                <div class="slds-notify__content  slds-align_absolute-center ">
                                    <lightning:icon alternativeText="Success" iconName="utility:success" size="small"
                                                    class="buttonColor slds-m-right_small" />
                                                    class="buttonColor slds-m-right_small"  variant="inverse"/>
                                    <h2 class="slds-text-heading_small ">{!v.successMessage}</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" variant="inverse"/>
                                      <span class="slds-assistive-text">Close</span>
                                    </button>
                                  </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="slds-modal slds-fade-in-open slds-hide" aura:id="errorDiv" style="z-index: 10001">
                <ui:inputText aura:id="articleURL"/>
                <!-- <ui:inputText aura:id="articleURL"/> -->
                <div class="demo-only" style="height: 8rem;">
                    <div class="slds-notify_container slds-is-relative">
                        <div class="slds-notify slds-notify_toast slds-theme_error" role="status">
                            <div class=" slds-m-left_xx-large">
                                <div class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large">
                        <div class="slds-notify slds-notify_toast slds-theme_error" style="background-color: #ba0517 !important;" role="status">
                            <div >
                                <div class="slds-notify__content  slds-align_absolute-center ">
                                    <lightning:icon alternativeText="error" iconName="utility:error" size="small"
                                                    class="buttonColor slds-m-right_small" />
                                                    class="buttonColor slds-m-right_small" variant="inverse"/>
                                    <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" />
                                        <lightning:icon alternativeText="close" iconName="utility:close" size="small" variant="inverse"/>
                                      <span class="slds-assistive-text">Close</span>
                                    </button>
                                  </div>
force-app/main/default/aura/taskManage/taskManage.css
@@ -13,4 +13,27 @@
    height: 20px;
}
.THIS html{font-family: Microsoft YaHei }
/*2021-10-19  mzy  任务管理改善  end*/
/*2021-10-19  mzy  任务管理改善  end*/
  .THIS :host{
    --slds-g-color-error-base-40: #ba0517 !important;
  }
   /* CSS 文件中的样式 */
   .THIS .spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8); /* 背景色,可以根据需要调整透明度 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* 确保覆盖其他内容 */
  }
  .THIS .spinner-overlay lightning-spinner {
    margin-top: -100px; /* 负值将图标向上移动 */
  }
force-app/main/default/aura/taskManage/taskManageController.js
@@ -179,6 +179,7 @@
    //2021-10-25 yjk 取消原因为失单,查看询价报告按钮 end
    ,closeMessage : function(cmp,event,helper){
        $A.util.addClass(cmp.find('errorDiv'), 'slds-hide');
        $A.util.addClass(cmp.find('successDiv'), 'slds-hide');
    }
});
force-app/main/default/aura/taskManage/taskManageHelper.js
@@ -928,7 +928,9 @@
        cmp.set("v.mergeIsOpen_Over", false);
        var selectedData = cmp.get("v.selectedData");
        if(!selectedData || selectedData.length <=1 ){
            alert("请选择两条以上的任务进行合并!");
            cmp.set("v.errorMessage", '请选择两条以上的任务进行合并!');
            this.showErrorToast(cmp);
            // alert("请选择两条以上的任务进行合并!");
            return;
        }
        var action = cmp.get("c.mergeTask");
@@ -990,7 +992,7 @@
                    this.showErrorToast(cmp);
                }else{
                    
                    window.open('/apex/PCLLostReportPage?pageStatus=Create&oppId=' + returnValue + '&lostType=失单','_blank');
                    window.open('/apex/PCLLostReportPageLwc?pageStatus=Create&oppId=' + returnValue + '&lostType=失单','_blank');
                }
            }else if (state === "ERROR") {
@@ -1052,45 +1054,61 @@
        if(IsGeneratePlan==false&&IsEventDefault==false){            
            //check 0            
            if(activityDateV==null||activityDateV==''||activityDateV==undefined){
                alert('选择未生成计划的话,则必须填写 拜访日');
                cmp.set("v.errorMessage", '选择未生成计划的话,则必须填写 拜访日');
                this.showErrorToast(cmp);
                // alert('选择未生成计划的话,则必须填写 拜访日');
                return;
            }
            if(feedbackPlanDateV==null||feedbackPlanDateV==''||feedbackPlanDateV==undefined){
                alert('选择未生成计划的话,则必须填写 计划反馈日');
                cmp.set("v.errorMessage", '选择未生成计划的话,则必须填写 计划反馈日');
                this.showErrorToast(cmp);
                // alert('选择未生成计划的话,则必须填写 计划反馈日');
                return;
            }
            //check 1
            var regx = new RegExp(/^\d{4}\-\d{2}\-\d{2}$/);
            if(!regx.test(activityDateV)){
                alert('请输入有效时间');
                cmp.set("v.errorMessage", '请输入有效时间');
                this.showErrorToast(cmp);
                // alert('请输入有效时间');
                return;
            }
            var regx = new RegExp(/^\d{4}\-\d{2}\-\d{2}$/);
            if(!regx.test(feedbackPlanDateV)){
                alert('请输入有效时间');
                cmp.set("v.errorMessage", '请输入有效时间');
                this.showErrorToast(cmp);
                // alert('请输入有效时间');
                return;
            }
            //check 2
            var today = new Date();
            if(today>=activityDate){
                alert('请输入今天以后的日期');
                cmp.set("v.errorMessage", '请输入今天以后的日期');
                this.showErrorToast(cmp);
                // alert('请输入今天以后的日期');
                return;
            }
            if(today>=feedbackPlanDate){
                alert('请输入今天以后的日期');
                cmp.set("v.errorMessage", '请输入今天以后的日期');
                this.showErrorToast(cmp);
                // alert('请输入今天以后的日期');
                return;
            }
            //2021-11-25  mzy  任务管理改善  start
            //check 3
            //计划反馈日不能超过希望完成日
            if(feedbackPlanDate>HopeCompletionDate){
                alert('计划反馈日不能超过希望完成日('+HopeCompletionDateV+')');
                cmp.set("v.errorMessage", '计划反馈日不能超过希望完成日('+HopeCompletionDateV+')');
                this.showErrorToast(cmp);
                // alert('计划反馈日不能超过希望完成日('+HopeCompletionDateV+')');
                return;
            }
            if(activityDate>HopeCompletionDate){
                alert('拜访日不能超过希望完成日('+HopeCompletionDateV+')');
                cmp.set("v.errorMessage", '拜访日不能超过希望完成日('+HopeCompletionDateV+')');
                this.showErrorToast(cmp);
                // alert('拜访日不能超过希望完成日('+HopeCompletionDateV+')');
                return;
            }
            //2021-11-25  mzy  任务管理改善  end
@@ -1106,13 +1124,17 @@
            var estimatedFinishDate = cmp.get("v.estimatedFinishDate");
            if (!estimatedFinishDate) {
                alert('请输入预计完成时间!');
                cmp.set("v.errorMessage", '请输入预计完成时间!');
                this.showErrorToast(cmp);
                // alert('请输入预计完成时间!');
                return;
            }
            var latestFinishDate = row.latestFinishDate;
            if (estimatedFinishDate > latestFinishDate) {
                alert('预计完成时间不能超过最晚完成日('+latestFinishDate+')');
                cmp.set("v.errorMessage", '预计完成时间不能超过最晚完成日('+latestFinishDate+')');
                this.showErrorToast(cmp);
                // alert('预计完成时间不能超过最晚完成日('+latestFinishDate+')');
                return;
            }
        }
@@ -1205,11 +1227,15 @@
        var cancelReason = cmp.get("v.cancelReason");
        var cancelReasonOther = cmp.get("v.cancelReasonOther");
        if(!cancelReason){
            alert('请输入取消理由!');
            cmp.set("v.errorMessage", '请输入取消理由!');
            this.showErrorToast(cmp);
            // alert('请输入取消理由!');
            return;
        }
        if(cancelReason == '其他' && !cancelReasonOther){
            alert('取消理由(选项)为其他时请输入取消理由(其他)!');
            cmp.set("v.errorMessage", '取消理由(选项)为其他时请输入取消理由(其他)!');
            this.showErrorToast(cmp);
            // alert('取消理由(选项)为其他时请输入取消理由(其他)!');
            return;
        }
@@ -1260,11 +1286,15 @@
        var delayReasonOther = cmp.get("v.delayReasonOther");
        if(!delayReason){
            alert('请输入延期理由!');
            cmp.set("v.errorMessage", '请输入延期理由!');
            this.showErrorToast(cmp);
            // alert('请输入延期理由!');
            return;
        }
        if(delayReason == '其他' && !delayReasonOther){
            alert('延期理由(选项)为其他时请输入延期理由(其他)!');
            cmp.set("v.errorMessage", '延期理由(选项)为其他时请输入延期理由(其他)!');
            this.showErrorToast(cmp);
            // alert('延期理由(选项)为其他时请输入延期理由(其他)!');
            return;
        }
        // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc Start
@@ -1274,13 +1304,17 @@
            var estimatedFinishDate = cmp.get("v.estimatedFinishDate");
            if (!estimatedFinishDate) {
                alert('请输入延期至时间!');
                cmp.set("v.errorMessage", '请输入延期至时间!');
                this.showErrorToast(cmp);
                // alert('请输入延期至时间!');
                return;
            }
            var createdAfter3Month = tempdata.createdAfter3Month;
            if (estimatedFinishDate > createdAfter3Month) {
                alert('延期至时间不能超过('+createdAfter3Month+')');
                cmp.set("v.errorMessage", '延期至时间不能超过('+createdAfter3Month+')');
                this.showErrorToast(cmp);
                // alert('延期至时间不能超过('+createdAfter3Month+')');
                return;
            }
        }
@@ -1338,7 +1372,9 @@
        cmp.set("v.assignIsOpen", false);
        var assignee =  cmp.get('v.subTempTask.assignee__c');
        if(!assignee){
            alert('请输入新被分配者!');
            cmp.set("v.errorMessage", '请输入新被分配者!');
            this.showErrorToast(cmp);
            // alert('请输入新被分配者!');
            return;
        }
        var action = cmp.get("c.resetAssignee");
@@ -1364,6 +1400,8 @@
                    cmp.set('v.data2', rows);
                    cmp.set('v.data2Copy',rows);
                    cmp.set("v.assignIsOpen", false);
                    cmp.set("v.successMessage", '重新分配成功!');
                    this.showSuccessToast(cmp);
                }else{
                    cmp.set("v.errorMessage", res.result);
                    this.showErrorToast(cmp);
@@ -1382,7 +1420,9 @@
        cmp.set("v.assignIsOpen_Over", false);
        var assignee =  cmp.get('v.subTempTask.assignee__c');
        if(!assignee){
            alert('请输入新被分配者!');
            cmp.set("v.errorMessage", '请输入新被分配者!');
            this.showErrorToast(cmp);
            // alert('请输入新被分配者!');
            return;
        }
        var action = cmp.get("c.resetAssignee_Owner");
@@ -1410,6 +1450,8 @@
                    cmp.set('v.data', rows);
                    cmp.set('v.dataCopy',rows);
                    cmp.set("v.assignIsOpen_Over", false);
                    cmp.set("v.successMessage", '重新分配成功!');
                    this.showSuccessToast(cmp);
                }else{
                    cmp.set("v.errorMessage", res.result);
                    this.showErrorToast(cmp);
@@ -1425,11 +1467,11 @@
    //弹出 成功提示
    showSuccessToast : function(cmp) {
        $A.util.removeClass(cmp.find('successDiv'), 'slds-hide');
        window.setTimeout($A.getCallback(function() {
            $A.util.addClass(cmp.find('successDiv'), 'slds-hide');
            }),
            5000
        );
        // window.setTimeout($A.getCallback(function() {
        //     $A.util.addClass(cmp.find('successDiv'), 'slds-hide');
        //     }),
        //     5000
        // );
    },
    //弹出 错误提示
    showErrorToast : function(cmp) {
force-app/main/default/classes/AccountDelayApplyHandler.cls
@@ -312,7 +312,7 @@
                    ada.CustomizePageFlg__c = false;
                }else{
                    System.debug('lt123-----else,ada.CustomizePageFlg__c-----'+ada.CustomizePageFlg__c);
                    ada.addError('请点击链接(相关项)确认具体信息后审批。');
                     ada.addError('请点击链接(相关项)确认具体信息后审批。');
                }
            }
        }
force-app/main/default/classes/ApprovalHistoryController.cls
New file
@@ -0,0 +1,533 @@
public without sharing class ApprovalHistoryController {
    public static final String APPROVE_ACTION = 'Approve';
    public static final String REJECT_ACTION = 'Reject';
    public static final String RECALL_ACTION = 'Removed';
    public class ReturnResult{
        @AuraEnabled
        public String returnMes;
        @AuraEnabled
        public Boolean success;
    }
    public class InitWrap{
        @AuraEnabled
        public String objJson;
        @AuraEnabled
        public String currentUserProfileId;
        @AuraEnabled
        public String nodeName;
    }
    @AuraEnabled
    public static InitWrap getInitData(String recordId, String objectApiName){
        InitWrap i = new InitWrap();
        List<ProcessInstanceWorkitem> workItems = [
            SELECT Id, ProcessInstanceId
            FROM ProcessInstanceWorkitem
            WHERE ProcessInstance.TargetObjectId = :recordId
        ];
        if (workItems.size()>0) {
            ProcessInstance proIn = [SELECT Id,SubmittedById, ProcessDefinition.Name , (SELECT ID, ProcessNodeId,
                                            StepStatus,Comments,TargetObjectId,ActorId,CreatedById,IsDeleted,IsPending
                                            ,OriginalActorId,ProcessInstanceId,RemindersSent,CreatedDate, Actor.Name,
                                            OriginalActor.Name , ProcessNode.Name FROM StepsAndWorkitems order by IsPending DESC,CreatedDate DESC)
                                            FROM ProcessInstance where Id=:workItems.get(0).ProcessInstanceId order by CreatedDate DESC];
            String nodeName = '';
            if(proIn.StepsAndWorkitems.size()>0 && proIn !=null){
                if(String.isNotBlank(proIn.StepsAndWorkitems[0].ProcessNode.Name)){
                    nodeName = proIn.StepsAndWorkitems[0].ProcessNode.Name;
                }
            }
            i.nodeName = nodeName;
        }
        if(objectApiName=='Account'){
            Account acc = [select id,Name,WhetherRiskPassing__c,RejectionReason__c,AssociatedHospital__c,InstitutionalType__c,HospitalType__c from Account where id=:recordId];
            String profileId = UserInfo.getProfileId();
            acc.RejectionReason__c = '';
            acc.AssociatedHospital__c = null;
            i.objJson = JSON.serialize(acc);
            i.currentUserProfileId = profileId;
            return i;
        }else if(objectApiName=='Account_Delay_Apply__c'){
            Account_Delay_Apply__c acc = [select id,InstitutionalType__c,HospitalType__c,WhetherRiskPassing__c from Account_Delay_Apply__c where id=:recordId];
            String profileId = UserInfo.getProfileId();
            i.objJson = JSON.serialize(acc);
            i.currentUserProfileId = profileId;
            return i;
        }else if(objectApiName=='Solution_Programme__c'){
            Solution_Programme__c acc = [select id,Confirmation_Result__c,Remarks__c,Scheme_Type__c from Solution_Programme__c where id=:recordId];
            String profileId = UserInfo.getProfileId();
            i.objJson = JSON.serialize(acc);
            i.currentUserProfileId = profileId;
            return i;
        }
        return i;
    }
    @AuraEnabled
    public static String saveRecord(String objectApiName, String objId, String objJson){
        system.debug(objectApiName);
        system.debug(objId);
        system.debug(objJson);
        if(objectApiName=='Account'){
            Account acc = (Account)JSON.deserialize(objJson, Account.class);
            acc.Id = objId;
            update acc;
        }else if(objectApiName=='Account_Delay_Apply__c'){
            Account_Delay_Apply__c accApply = (Account_Delay_Apply__c)JSON.deserialize(objJson, Account_Delay_Apply__c.class);
            accApply.Id = objId;
            update accApply;
        }else if(objectApiName=='Solution_Programme__c'){
            Solution_Programme__c sol = (Solution_Programme__c)JSON.deserialize(objJson, Solution_Programme__c.class);
            sol.Id = objId;
            update sol;
        }
        return '200';
    }
    @AuraEnabled(Cacheable=true)
    public static List<LookupSearchResult> searchUsers(String searchTerm) {
        // Prepare query paramters
        searchTerm += '*';
        // Execute search query
        List<List<SObject>> searchResults = [
            FIND :searchTerm
            IN ALL FIELDS
            RETURNING
                User(Id, FirstName, LastName)
            LIMIT :ApprovalHistoryUtil.MAX_RESULTS
        ];
        // Prepare results
        List<LookupSearchResult> results = new List<LookupSearchResult>();
        // Extract Accounts & convert them into LookupSearchResult
        String userIcon = 'standard:user';
        User[] users = (List<User>) searchResults[0];
        for (User currUser : users) {
            results.add(
                new LookupSearchResult(
                    currUser.Id,
                    'User',
                    userIcon,
                    currUser.FirstName + ' ' + currUser.LastName,
                    ''
                )
            );
        }
        // Optionnaly sort all results on title
        results.sort();
        return results;
    }
    @AuraEnabled
    public static String processStep(String recordId, String comments, String nextApproverId, String action,String objApiName,String modalsubmitLabel,String objJson){
        List<ProcessInstanceWorkitem> workItems = [
            SELECT Id, ProcessInstanceId
            FROM ProcessInstanceWorkitem
            WHERE ProcessInstance.TargetObjectId = :recordId
        ];
        if(workItems.isEmpty()){
            return '';
        }
        Account obj;
        Account_Delay_Apply__c accApply;
        Solution_Programme__c sol;
        if(objApiName=='Account'){
            obj = (Account)JSON.deserialize(objJson, Account.class);
        }else if(objApiName=='Account_Delay_Apply__c'){
            accApply = (Account_Delay_Apply__c)JSON.deserialize(objJson, Account_Delay_Apply__c.class);
        }else if(objApiName=='Solution_Programme__c'){
            sol = (Solution_Programme__c)JSON.deserialize(objJson, Solution_Programme__c.class);
        }
        // List<ProcessInstanceStep> pList = [select id,StepNodeId,StepStatus from ProcessInstanceStep
        // where ProcessInstanceId=:workItems.get(0).ProcessInstanceId];
        system.debug(workItems);
        ProcessInstance proIn = [SELECT Id,SubmittedById, ProcessDefinition.Name , (SELECT ID, ProcessNodeId,
                                            StepStatus,Comments,TargetObjectId,ActorId,CreatedById,IsDeleted,IsPending
                                            ,OriginalActorId,ProcessInstanceId,RemindersSent,CreatedDate, Actor.Name,
                                            OriginalActor.Name , ProcessNode.Name FROM StepsAndWorkitems order by IsPending DESC,CreatedDate DESC)
                                            FROM ProcessInstance where Id=:workItems.get(0).ProcessInstanceId order by CreatedDate DESC];
        String nodeName = '';
        system.debug(proIn);
        if(proIn.StepsAndWorkitems.size()>0){
            if(String.isNotBlank(proIn.StepsAndWorkitems[0].ProcessNode.Name)){
                nodeName = proIn.StepsAndWorkitems[0].ProcessNode.Name;
            }
        }
        // for(ProcessInstanceHistory step : proIn.StepsAndWorkitems){
        //     if(String.isNotBlank(step.ProcessNode.Name)){
        //         system.debug(step.ProcessNode.Name);
        //         nodeName = step.ProcessNode.Name;
        //     }
        // }
        String returnMes = '';
        system.debug('----');
        system.debug(obj);
        system.debug(accApply);
        system.debug(sol);
        system.debug(objApiName);
        system.debug(nodeName);
        system.debug(modalsubmitLabel);
        system.debug(nextApproverId);
        if(String.isNotBlank(nodeName)){
            system.debug('qqqqq');
            String testlink = nodeName;
            // obj.Id = recordId;
            if(objApiName=='Account'){
                obj.CustomizePageFlg__c = true;
                if(modalsubmitLabel == '批准' || modalsubmitLabel == '拒绝'){
                    system.debug('1');
                    Date today = Date.today();
                    // if(testlink.contains('医院新建审批_营业支援部') ){
                    if(testlink.contains('医院新建审批_事业推进部') ){
                        system.debug('1-1');
                        if(modalsubmitLabel == '批准'){
                            system.debug('1-1-1');
                            if(!String.isBlank(obj.RejectionReason__c)){
                                returnMes='您已填写驳回理由,批准不需要驳回理由。';
                            }
                            if(String.isBlank(obj.InstitutionalType__c)){
                                returnMes= '批准前,机构类型必填。';
                            }
                            if(obj.InstitutionalType__c == '非医疗机构' && String.isBlank(obj.HospitalType__c)){
                                returnMes= '非医疗机构请选择医院类型。';
                            }
                            if(obj.InstitutionalType__c == '医疗机构' && !String.isBlank(obj.HospitalType__c)){
                                returnMes= '医疗机构不需要选择医院类型。';
                            }
                            if(obj.InstitutionalType__c == '医疗机构'){
                                obj.Is_Active__c = '有効';
                                obj.Approved_Confirm_Date__c = today;
                            }
                        }
                        //拒绝
                        if(modalsubmitLabel == '拒绝'){
                            if(String.isBlank(obj.RejectionReason__c)){
                                returnMes= '拒绝前,请选择驳回理由。';
                            }
                            if(obj.RejectionReason__c == '重复' && String.isBlank(obj.AssociatedHospital__c)){
                                returnMes= '驳回理由是重复的,请填写关联医院。';
                            }
                            if(obj.RejectionReason__c != '重复' && !String.isBlank(obj.AssociatedHospital__c)){
                                returnMes= '驳回理由不是重复的,不能填写关联医院。';
                            }
                            if(!String.isBlank(obj.RejectionReason__c) && (!String.isBlank(obj.InstitutionalType__c)||!String.isBlank(obj.HospitalType__c))){
                                returnMes= '审批拒绝,不允许填写机构类型或医院类型。';
                            }
                            if(obj.RejectionReason__c == '医院已关张' || obj.RejectionReason__c == '重复'){
                                system.debug('拒绝——驳回');
                                obj.Is_Active__c = '驳回';
                            }else{
                                system.debug('拒绝——草案中');
                                obj.Is_Active__c = '草案中';
                            }
                        }
                    }else if(testlink.contains('质量法规二级部长') ){
                        system.debug('22222222222222');
                        if(modalsubmitLabel == '批准'){
                            system.debug('2-2222');
                            if(obj.InstitutionalType__c == '非医疗机构' && obj.HospitalType__c == '高等院校'){
                                system.debug('2-3333333');
                                obj.Is_Active__c = '有効';
                                obj.Approved_Confirm_Date__c = today;
                            }
                        }
                        if(modalsubmitLabel == '拒绝'){
                            obj.Is_Active__c = '驳回';
                            obj.Approved_Confirm_Date__c = today;
                        }
                    }else if(testlink.contains('经销商管理部一级审批')){
                        if(modalsubmitLabel == '批准'){
                            if(String.isBlank(obj.WhetherRiskPassing__c)){
                                returnMes= '是否为有风险通过 必填。';
                            }else if(obj.InstitutionalType__c == '非医疗机构' && obj.HospitalType__c == '企业集团' && (obj.WhetherRiskPassing__c == '否'||String.isBlank(obj.WhetherRiskPassing__c))){
                                obj.Is_Active__c = '有効';
                                obj.Approved_Confirm_Date__c = today;
                            }
                        }
                        if(modalsubmitLabel == '拒绝'){
                            obj.Is_Active__c = '驳回';
                        }
                    }else if(testlink.contains('总经理审批')){
                        if(modalsubmitLabel == '批准'){
                            obj.Is_Active__c = '有効';
                            obj.Approved_Confirm_Date__c = today;
                        }
                        if(modalsubmitLabel == '拒绝'){
                            obj.Is_Active__c = '驳回';
                        }
                    }else{
                        if(modalsubmitLabel == '拒绝'){
                            obj.Is_Active__c = '驳回';
                        }
                    }
                }
            }else if(objApiName=='Account_Delay_Apply__c'){
                system.debug('Account_Delay_Apply__c');
                accApply.CustomizePageFlg__c = true;
                if(modalsubmitLabel == '批准' || modalsubmitLabel == '拒绝'){
                    system.debug('1111');
                    if(testlink.contains('营业窗口审批')){
                        system.debug('2222');
                        if(modalsubmitLabel == '拒绝'){
                            system.debug('3333');
                            accApply.Is_Active__c = '草案中';
                        }
                    // }else if(testlink.contains('医院新建审批_营业支援部') ){
                    }else if(testlink.contains('医院变更审批_事业推进部') ){
                        system.debug('医院变更审批_事业推进部');
                        system.debug(accApply.InstitutionalType__c);
                        system.debug(accApply.HospitalType__c);
                        if(modalsubmitLabel == '批准'){
                            if(accApply.InstitutionalType__c == null){
                                returnMes='批准前,机构类型必填。';
                            }
                            if(accApply.InstitutionalType__c == '非医疗机构' && accApply.HospitalType__c == null){
                                returnMes='非医疗机构请选择医院类型。';
                            }
                            if(accApply.InstitutionalType__c == '医疗机构' && accApply.HospitalType__c != null){
                                returnMes='医疗机构不需要选择医院类型。';
                            }
                            if(accApply.InstitutionalType__c == '医疗机构'){
                                accApply.Is_Active__c = '审批通过';
                                accApply.Approved_Confirm_Date__c = Date.today();
                            }
                        }
                        if(modalsubmitLabel == '拒绝'){
                            if(accApply.InstitutionalType__c == null){
                                returnMes='拒绝前,机构类型必填。';
                            }
                            // accApply.Is_Active__c = '草案中';
                            if(accApply.InstitutionalType__c == '医疗机构'){
                                accApply.Is_Active__c = '驳回';
                            }else if(accApply.InstitutionalType__c == '非医疗机构'){
                                accApply.Is_Active__c = '草案中';
                            }
                        }
                    }else if(testlink.contains('质量法规二级部长') ){
                        system.debug('质量法规二级部长');
                        if(modalsubmitLabel == '批准'){
                           if(accApply.InstitutionalType__c == '非医疗机构' && accApply.HospitalType__c == '高等院校'){
                              accApply.Is_Active__c = '审批通过';
                              accApply.Approved_Confirm_Date__c = Date.today();
                           }
                        }
                        if(modalsubmitLabel == '拒绝'){
                            accApply.Is_Active__c = '驳回';
                        }
                     }else if(testlink.contains('经销商管理部一级审批')){
                        system.debug('经销商管理部一级审批');
                        if(modalsubmitLabel == '批准'){
                            if(String.isBlank(accApply.WhetherRiskPassing__c)){
                                returnMes='是否为有风险通过 必填。';
                            }
                           if(accApply.InstitutionalType__c == '非医疗机构' && accApply.HospitalType__c == '企业集团' && accApply.WhetherRiskPassing__c == '否'){
                              accApply.Is_Active__c = '审批通过';
                              accApply.Approved_Confirm_Date__c = Date.today();
                           }
                        }
                        if(modalsubmitLabel == '拒绝'){
                            accApply.Is_Active__c = '驳回';
                        }
                    }else if(testlink.contains('总经理审批')){
                        system.debug('总经理审批');
                        if(modalsubmitLabel == '批准'){
                            accApply.Is_Active__c = '审批通过';
                            accApply.Approved_Confirm_Date__c = Date.today();
                        }
                        if(modalsubmitLabel == '拒绝'){
                            accApply.Is_Active__c = '驳回';
                        }
                    }else{
                        system.debug('else');
                        if(modalsubmitLabel == '拒绝'){
                            accApply.Is_Active__c = '驳回';
                        }
                    }
                }
            }else if(objApiName=='Solution_Programme__c'){
                // if(modalsubmitLabel == '批准'){
                //     returnMes='请填写反馈结果,并按审批按钮';
                // }
                // if(sol.Confirmation_Result__c == null){
                //     returnMes='批准之前必须填写反馈结果!';
                // }
                if(modalsubmitLabel == '拒绝'){
                    returnMes='请填写反馈结果,并按审批按钮';
                }
                if(modalsubmitLabel == '批准'&&sol.Confirmation_Result__c == null){
                    returnMes='请填写反馈结果,并按审批按钮';
                }
                // sol.ProcessOfApproval__c = false;
            }
        }
        system.debug('end');
        system.debug(returnMes);
        ReturnResult r = new ReturnResult();
        if(String.isNotBlank(returnMes)){
            r.returnMes=returnMes;
            r.success=false;
            return JSON.serialize(r);
        }
        try{
            if(objApiName=='Account'){
                update obj;
            }else if(objApiName=='Account_Delay_Apply__c'){
                update accApply;
            }else if(objApiName=='Solution_Programme__c'){
                update sol;
            }
        }catch(Exception e){
            r.returnMes=e.getMessage();
            r.success=false;
            return JSON.serialize(r);
        }
        String result = ApprovalHistoryUtil.processStep(workItems,comments, nextApproverId,action);
        system.debug('result:'+result);
        return result;
    }
    @AuraEnabled
    public static void reassignStep(String recordId, String newActorId ){
        List<ProcessInstanceWorkItem> workItemList = [SELECT ActorId FROM ProcessInstanceWorkitem WHERE ProcessInstance.TargetObjectId = : recordId];
        ApprovalHistoryUtil.reassignStep(workItemList, newActorId);
    }
    @AuraEnabled
    public static String submitForApproval(String recordId, String comments, String nextApproverId){
        Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
        req.setComments(comments);
        if(!String.isBlank(nextApproverId)){
            req.setNextApproverIds(new Id[] {nextApproverId});
        }
        req.setObjectId(recordId);
        // Submit on behalf of a specific submitter
        req.setSubmitterId(ApprovalHistoryUtil.currentUserId);
        // Submit the approval request for the account
        Approval.ProcessResult result = Approval.process(req);
        return JSON.serialize(result);
    }
    @AuraEnabled (cacheable=true)
    public static ApprovalHistory getApprovalHistory(String recordId){
        List<ProcessInstance> processInstances = [SELECT Id,SubmittedById, ProcessDefinition.Name , (SELECT ID, ProcessNodeId,
                                                            StepStatus,Comments,TargetObjectId,ActorId,CreatedById,IsDeleted,IsPending
                                                            ,OriginalActorId,ProcessInstanceId,RemindersSent,CreatedDate, Actor.Name,
                                                            OriginalActor.Name , ProcessNode.Name FROM StepsAndWorkitems order by IsPending DESC, CreatedDate DESC )
                                                    FROM ProcessInstance where TargetObjectId =:recordId order by CreatedDate DESC];
        return ApprovalHistoryUtil.populateApprovalHistorySteps(processInstances, recordId);
    }
    public class ApprovalHistoryStep{
        @AuraEnabled
        public String stepName {get;set;}
        @AuraEnabled
        public String stepUrl {get;set;}
        @AuraEnabled
        public DateTime createdDate {get;set;}
        @AuraEnabled
        public String stepStatus {get;set;}
        @AuraEnabled
        public String assignedTo {get;set;}
        @AuraEnabled
        public String assignedToUrl {get;set;}
        @AuraEnabled
        public String OriginalTo {get;set;}
        @AuraEnabled
        public String OriginalToUrl {get;set;}
        @AuraEnabled
        public String comments {get;set;}
        public ApprovalHistoryStep(
            String stepName,
            String stepId,
            DateTime createdDate,
            String stepStatus,
            String assignedTo,
            String assignedToId,
            String comments )
        {
            this.stepName = stepName;
            this.stepUrl = '/' + stepId;
            this.createdDate = createdDate;
            this.assignedTo = assignedTo;
            this.assignedToUrl = '/'+assignedToId;
            this.comments = comments;
            if(stepStatus == ApprovalHistoryUtil.STATUS_STARTED){
                this.stepStatus = ApprovalHistoryUtil.STATUS_SUBMITTED;
            }else if(stepStatus == ApprovalHistoryUtil.STATUS_REMOVED){
                this.stepStatus = ApprovalHistoryUtil.STATUS_RECALLED;
            }else{
                this.stepStatus = stepStatus;
            }
        }
        public ApprovalHistoryStep(
            String stepName,
            String stepId,
            DateTime createdDate,
            String stepStatus,
            String assignedTo,
            String assignedToId,
            String OriginalTo,
            String OriginalToId,
            String comments )
        {
            this.stepName = stepName;
            this.stepUrl = '/' + stepId;
            this.createdDate = createdDate;
            this.assignedTo = assignedTo;
            this.assignedToUrl = '/'+assignedToId;
            this.OriginalTo = OriginalTo;
            this.OriginalToUrl = '/'+OriginalToId;
            this.comments = comments;
            if(stepStatus == ApprovalHistoryUtil.STATUS_STARTED){
                this.stepStatus = ApprovalHistoryUtil.STATUS_SUBMITTED;
            }else if(stepStatus == ApprovalHistoryUtil.STATUS_REMOVED){
                this.stepStatus = ApprovalHistoryUtil.STATUS_RECALLED;
            }else{
                this.stepStatus = stepStatus;
            }
        }
    }
    public class ApprovalHistory{
        @AuraEnabled
        public List<ApprovalHistoryStep> approvalSteps;
        @AuraEnabled
        public String approvalStepsSize;
        @AuraEnabled
        public boolean isCurrentUserApprover;
        @AuraEnabled
        public boolean showRecall;  //Modify All Data" permission or "Modify All" on the object level
                                    // system admin and submitter(if it says so on the approval process)
                                        //SELECT Name FROM Profile WHERE PermissionsModifyAllData = true
                                    //query permission sets with modify all or modify all for object and see if curr user has them
        @AuraEnabled
        public boolean showSubmitForApproval;
        public ApprovalHistory(List<ApprovalHistoryStep> approvalSteps, boolean isCurrentUserApprover, boolean isSubmitForApproval, boolean showRecall){
            this.approvalSteps = approvalSteps;
            this.isCurrentUserApprover = isCurrentUserApprover;
            //this.approvalStepsSize = moreThan6Steps ? '6+' : string.valueOf(approvalSteps.size());
            this.showSubmitForApproval = isSubmitForApproval;
            this.showRecall = showRecall;
        }
    }
}
force-app/main/default/classes/ApprovalHistoryController.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>57.0</apiVersion>
    <status>Active</status>
</ApexClass>
force-app/main/default/classes/ApprovalHistoryUtil.cls
New file
@@ -0,0 +1,146 @@
public without sharing class ApprovalHistoryUtil {
    public static final String STATUS_SUBMITTED = 'Submitted';
    public static final String STATUS_STARTED = 'Started';
    public static final String STATUS_PENDING = 'Pending';
    public static final String STATUS_RECALLED = 'Recalled';
    public static final String STATUS_REMOVED = 'Removed';
    public static final Id currentUserId = UserInfo.getUserId();
    public final static Integer MAX_RESULTS = 5;
    //work in progress
    public static boolean isCurrentUserSystemAdmin(Id recordId){
        String profileId = UserInfo.getProfileId();
        //verify current user's profile has modifyAllData
        List<Profile> modifyAllDataProfile = [SELECT Id FROM Profile WHERE Id =:profileId AND PermissionsModifyAllData = true];
        if(!modifyAllDataProfile.isEmpty()){
            return true;
        }
        //verify current user's profile has modify all of the current object permission
        String objType = recordId.getsobjecttype().getDescribe().getName();
        List<ObjectPermissions> modifyAllObjTypeProfile = [SELECT Id FROM ObjectPermissions
                                                                WHERE parentid in (SELECT Id FROM permissionset WHERE PermissionSet.Profile.Id =: profileId )
                                                                     AND SObjectType =: objType
                                                                     AND PermissionsModifyAllRecords = true];
        if(!modifyAllObjTypeProfile.isEmpty() && !Test.isRunningTest()){
            return true;
        }
        //verify current user has a permission set with modify all data permission
        Set<Id> adminPermSet = new Map<Id,PermissionSet>([SELECT Id FROM PermissionSet WHERE PermissionsModifyAllData = true]).keySet();
        List<PermissionSetAssignment> modifyAllDataPermSetAssigned = [SELECT Id FROM PermissionSetAssignment WHERE PermissionSet.Id in :adminPermSet AND Assignee.Id =:currentUserId ];
        if(!modifyAllDataPermSetAssigned.isEmpty() && !Test.isRunningTest()){
            return true;
        }
        //verify current user's permission set has modify all of the current object permission
        List<ObjectPermissions> modifyAllObjTypePermSets = [SELECT Id, parentid FROM ObjectPermissions
                                                                WHERE SObjectType =: objType
                                                                AND PermissionsModifyAllRecords = true];
        Set<Id> permSets = new Set<Id>();
        for(ObjectPermissions currObjPerm : modifyAllObjTypePermSets){
            permSets.add(currObjPerm.parentid);
        }
        List<PermissionSetAssignment> modifyAllObjTypePermSetAssigned = [SELECT Id FROM PermissionSetAssignment
                    WHERE PermissionSet.Id in :permSets
                            AND Assignee.Id =:currentUserId ];
        if(!modifyAllObjTypePermSetAssigned.isEmpty() && !Test.isRunningTest()){
            return true;
        }
        return false;
    }
    public static ApprovalHistoryController.ApprovalHistory populateApprovalHistorySteps(List<ProcessInstance> processInstances, String recordId){
        boolean isCurrentUserAdmin = ApprovalHistoryUtil.isCurrentUserSystemAdmin(recordId);
        boolean isCurrentUserApprover = false;
        boolean isSubmitForApproval = true;
        boolean showRecall = false ;    //true if one step pending, system admin or submitter(if enabled - need to figure out how to see if App process has checkbox enabled)
        List<ApprovalHistoryController.ApprovalHistoryStep> steps = new List<ApprovalHistoryController.ApprovalHistoryStep>();
        //Iterating through processInstance records to build the approval history steps
        Integer currNumberOfSteps = 0;
        boolean moreThan6Steps = false;
        ApprovalHistoryController.ApprovalHistory approvalHistoryToReturn = new ApprovalHistoryController.ApprovalHistory(steps,isCurrentUserApprover, isSubmitForApproval, showRecall);
        for(ProcessInstance pr :  processInstances){
            if(moreThan6Steps){
                break;
            }
            for(ProcessInstanceHistory step : pr.StepsAndWorkitems){
                currNumberOfSteps ++;
                if(currNumberOfSteps > 6){
                    moreThan6Steps = true;
                    break;
                }
                populateApprovalHistoryRecord(approvalHistoryToReturn, step,isCurrentUserAdmin,pr.submittedById);
                String stepStatus = step.StepStatus;
                system.debug('!!!!!!!!!!!!!!!!!!!!!!!!');
                system.debug(step.StepStatus);
                if(step.StepStatus=='Pending'){
                    stepStatus = '待处理';
                }else if(step.StepStatus=='Approved'){
                    stepStatus = '已批准';
                }else if(step.StepStatus=='NoResponse'){
                    stepStatus = '无响应';
                }else if(step.StepStatus=='Started'){
                    stepStatus = '已提交';
                }else if(step.StepStatus=='Rejected'){
                    stepStatus = '已拒绝';
                }
                system.debug(stepStatus);
                steps.add(new ApprovalHistoryController.ApprovalHistoryStep( step.ProcessNode.Name == null ? pr.ProcessDefinition.Name  : step.ProcessNode.Name,step.Id, step.CreatedDate,  stepStatus, step.Actor.Name,step.Actor.Id,step.OriginalActor.Name,step.OriginalActorId,step.Comments));
            }
        }
        approvalHistoryToReturn.approvalStepsSize = moreThan6Steps ? '6+' : string.valueOf(approvalHistoryToReturn.approvalSteps.size());
        return approvalHistoryToReturn;
    }
    public static String processStep(List<ProcessInstanceWorkitem> workItems, String comments, String nextApproverId, String action){
        if(workItems.isEmpty()){
            return '';
        }
        Approval.ProcessWorkitemRequest req = new Approval.ProcessWorkitemRequest();
        req.setWorkitemId(workItems.get(0).Id);
        req.setAction(action);
        req.setComments(comments);
        if(!String.isBlank(nextApproverId)){
            req.setNextApproverIds(new Id[] {nextApproverId});
        }
        Approval.ProcessResult result = Approval.process(req);
        return JSON.serialize(result);
    }
    public static void reassignStep(List<ProcessInstanceWorkItem> workItemList, String newActorId){
        if(workItemList.isEmpty()){
            return;
        }
        workItemList.get(0).ActorId  = newActorId;
        update workItemList;
    }
    public static void populateApprovalHistoryRecord(ApprovalHistoryController.ApprovalHistory approvalHistoryToReturn,ProcessInstanceHistory step, boolean isCurrentUserAdmin, String submittedById ){
        if(step.stepStatus == ApprovalHistoryUtil.STATUS_PENDING || Test.isRunningTest()){
            approvalHistoryToReturn.showSubmitForApproval = false;
            if((step.Actor.Id == ApprovalHistoryUtil.currentUserId || isCurrentUserAdmin) || Test.isRunningTest()){
                approvalHistoryToReturn.isCurrentUserApprover = true;
            }
            if(isCurrentUserAdmin || submittedById == ApprovalHistoryUtil.currentUserId || Test.isRunningTest()){
                approvalHistoryToReturn.showRecall = true;
            }
        }
    }
}
force-app/main/default/classes/ApprovalHistoryUtil.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>57.0</apiVersion>
    <status>Active</status>
</ApexClass>
force-app/main/default/classes/AssetMaintainController.cls
@@ -1605,6 +1605,7 @@
                    fieldValue = '';
                }
                Boolean meet = false;
                System.debug(fieldValueInRecord + operator + String.valueOf(fieldValue));
                if (operator == '==' && fieldValueInRecord == String.valueOf(fieldValue)) {
                    meet = true;
                }
force-app/main/default/classes/FixtureRentalPDFController.cls
@@ -116,15 +116,18 @@
                                QRId__c,
                                AWS_Data_Id__c,//20220304 
                                Direct_Shippment_Address_Encrypt__c,//20220304
                                Phone_Number_Encrypt__c//20220304
                                Phone_Number_Encrypt__c,//20220304
                                Routine_Check_Status__c,//20230526 lc DB202303417030 add
                                Routine_Check_Day__c,//20230526 lc DB202303417030 add
                                Routine_Check_Person__c//20230526 lc DB202303417030 add
                        from  Rental_Apply__c
                        where id = :rentalApplyId];
        }
        if(ApplyList.size()>0){
            ApplyHeadShow = ApplyList[0];
            qrcode = ConsumTrialPDFController.GetImageBase64(ApplyHeadShow.QRId__c);
            barcode = ConsumTrialPDFController.GetImageBase64(ApplyHeadShow.BRId__c);
            qrcode = ConsumTrialPDFController.GetImageBase64(ApplyHeadShow.QRId__c,'QR');
            barcode = ConsumTrialPDFController.GetImageBase64(ApplyHeadShow.BRId__c,'BR');
        }
        //增加借出备品SET一览List,为了获取借出备品SET一览明细
        List<String> RAESSearchList = New List<String>();
force-app/main/default/classes/InquiryFormHandler.cls
@@ -204,10 +204,12 @@
                }
                //20220511 you SWAG-CBUB2W end 
                //不需要日期,跟进日期,服务跟进日期,创建意向日期,比较最早日期
                //20230710 you DB202306544691  增加 转服务跟进日期
                String date1;
                String date2;
                String date3;
                String date4;
                String date6;
                if(null != nObj.No_Need_Date__c){
                  date1=String.valueOf(nObj.No_Need_Date__c);
                }
@@ -220,11 +222,14 @@
                if(null != nObj.Service_Follow_Date__c){
                  date4=String.valueOf(nObj.Service_Follow_Date__c);
                }
                if(null != nObj.Transfer_Service_Follow_Date__c){
                  date6=String.valueOf(nObj.Transfer_Service_Follow_Date__c);
                }
                //方法调用 
                 Date date_MD;
                 if((String.isNotBlank(date1) && nObj.No_Need_Date__c !=oldMap.get(nObj.Id).No_Need_Date__c) || (String.isNotBlank(date2) && nObj.Follow_Date__c !=oldMap.get(nObj.Id).Follow_Date__c) || (String.isNotBlank(date3) && nObj.Confirmation_Date__c !=oldMap.get(nObj.Id).Confirmation_Date__c) || (String.isNotBlank(date4) && nObj.Service_Follow_Date__c !=oldMap.get(nObj.Id).Service_Follow_Date__c)){
                    date_MD =getBigTime(date1,date2,date3,date4);
                 if((String.isNotBlank(date1) && nObj.No_Need_Date__c !=oldMap.get(nObj.Id).No_Need_Date__c) || (String.isNotBlank(date2) && nObj.Follow_Date__c !=oldMap.get(nObj.Id).Follow_Date__c) || (String.isNotBlank(date3) && nObj.Confirmation_Date__c !=oldMap.get(nObj.Id).Confirmation_Date__c) || (String.isNotBlank(date4) && nObj.Service_Follow_Date__c !=oldMap.get(nObj.Id).Service_Follow_Date__c) || (String.isNotBlank(date6) && nObj.Transfer_Service_Follow_Date__c !=oldMap.get(nObj.Id).Transfer_Service_Follow_Date__c)){
                    date_MD =getBigTime(date1,date2,date3,date4,date6);
                    nObj.MinimumDate__c = date_MD;//最小日期
                    String date5 = nObj.CreateDate__c==null?'':String.valueOf(nObj.CreateDate__c);
                    if(null != nObj.CreateDate__c){
@@ -238,6 +243,7 @@
                    }
                   
                 } 
                 /**
                 //处理老数据
                 if( System.Label.Inquiry_form_flag == 'True' && null != nObj.CreateDate__c){
                    if(String.isNotBlank(date1) || String.isNotBlank(date2) || String.isNotBlank(date3) || String.isNotBlank(date4)){
@@ -250,6 +256,7 @@
                    }
                 }
                 system.debug('==='+date_MD);
                 **/
                }
            
            
@@ -402,12 +409,13 @@
     }
     //20220419 you SWAG-CBUB2W end
 //多个日期比较最小日期
    public static Date getBigTime(String date1, String date2, String date3, String date4) {
    public static Date getBigTime(String date1, String date2, String date3, String date4, String date6) {
        system.debug(date1+'======'+date2+'====='+date3);
         long millis1 =0;
         Long millis2 =0;
         Long millis3 =0;
         Long millis4 =0;
         Long millis6 =0;
         List<Long> list_dateDecimal = new List<Long>();
         if(String.isNotBlank(date1)){
           millis1 = Datetime.valueOf(date1+' 08:00:05').getTime();
@@ -424,6 +432,10 @@
         if(String.isNotBlank(date4)){
           millis4 = Datetime.valueOf(date4+' 08:00:05').getTime();
           list_dateDecimal.add(millis4);
         }
         if(String.isNotBlank(date6)){
           millis6 = Datetime.valueOf(date6+' 08:00:05').getTime();
           list_dateDecimal.add(millis6);
         }
         
         list_dateDecimal.sort();
@@ -583,199 +595,6 @@
   
     @TestVisible private static void test() {
        Integer i = 0;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        i++;
        //可以多写点
    }
}
force-app/main/default/classes/LostCancelReportHandler.cls
@@ -17,7 +17,8 @@
        updateManager();
        //【FY23询价改善】-P:中标结果确认任务开发  20220706  更新失单任务确认时间
        updateLostTaskTime();
        // 更新营业助理
        updateSalesAssistant();
    }
    // 更新审批人 20200302 End
@@ -30,7 +31,7 @@
    //2022-6-22 yjk 询价跟进任务 start
    protected override void afterInsert() {
        updateTask();
        updateTask();
    }
    // 2022-7-29 ssm XLIU-CGSC8R 【委托】[改善】询价里删除批准的失单报告状态1自动变
@@ -41,14 +42,15 @@
    private void updateTask(){
        List<Id> oppIdList = new List<Id>();
        Set<Id> oppIdSet = new Set<Id>();
        Set<Id> oppIdSet = new Set<Id>();
        Set<Id> sdoppidSet = new Set<Id>();
        List<Id> updateOppId = new List<Id>(); 
        List<Opportunity> updateOpp = new List<Opportunity>();
        Map<String,String> cancelMap = new Map<String,String>();//lt 20230425 招标终止 add
        
        for(Lost_cancel_report__c lcr : newList){
            oppIdList.add(lcr.Opportunity__c);
            cancelMap.put(lcr.Opportunity__c, lcr.RecordType.Name);//lt 20230425 招标终止 add
        }
        // 20221202 ljh DB202211594688  start
        // List<task__c> taskList = [select id,taskStatus__c,OpportunityId__c from task__c where RecordType.Name ='中标结果确认' and taskStatus__c = '02 接受' and OpportunityId__c in :oppIdList];
@@ -57,8 +59,22 @@
        //     //updateOppId.add(tsk.OpportunityId__c); //20220823 you 没有任务时,
        // }
        // LoseListTask 失单报告任务   winBiddingTask  中标结果确认
        List<task__c> taskList = [select id,taskStatus__c,OpportunityId__c,RecordType.Name from task__c where (RecordType.Name ='中标结果确认' or RecordType.Name ='失单报告任务')  and OpportunityId__c in :oppIdList];
        for(task__c tsk : taskList){
        List<task__c> taskList = [select id,taskStatus__c,OpportunityId__c,RecordType.Name
                                  from task__c
                                  where (RecordType.Name ='中标结果确认' or RecordType.Name ='失单报告任务')
                                  and OpportunityId__c in :oppIdList];
        // 20230508 ljh DB202305008316 start
        /*for(task__c tsk : taskList){
            //lt 20230425 招标终止 start
            System.debug('---lt123---cancelMap:'+cancelMap);
            System.debug('---lt123---cancelMap.get(tsk.OpportunityId__c):'+cancelMap.get(tsk.OpportunityId__c));
            if(cancelMap.containsKey(tsk.OpportunityId__c)){
                if(cancelMap.get(tsk.OpportunityId__c) == 'PCL_Cancel_report'){
                    tsk.taskStatus__c = '04 取消';
                    tsk.cancelReasonSelect__c = '项目终止';
                }
            }else
            //lt 20230425 招标终止 end
            if(tsk.RecordType.Name == '中标结果确认' && tsk.taskStatus__c == '02 接受'){
                tsk.taskStatus__c = '03 完成';
            }
@@ -67,7 +83,28 @@
                sdoppidSet.add(tsk.OpportunityId__c);
            }
            oppIdSet.add(tsk.OpportunityId__c);
        }*/
        List<task__c> Uptask = new List<task__c>();
        for(task__c tsk : taskList){
            task__c temp = new task__c();
            temp.Id = tsk.Id;
            if(cancelMap.containsKey(tsk.OpportunityId__c)){
                if(cancelMap.get(tsk.OpportunityId__c) == 'PCL_Cancel_report'){
                    temp.taskStatus__c = '04 取消';
                    temp.cancelReasonSelect__c = '项目终止';
                }
            }else
            if(tsk.RecordType.Name == '中标结果确认' && tsk.taskStatus__c == '02 接受'){
                temp.taskStatus__c = '03 完成';
            }
            if(tsk.RecordType.Name == '失单报告任务'){
                sdoppidSet.add(tsk.OpportunityId__c);
            }
            oppIdSet.add(tsk.OpportunityId__c);
            Uptask.add(temp);
        }
        // 20230508 ljh DB202305008316 end
        // for(Id oppId : oppIdList){//20220823 you
        for(Id oppId : oppIdSet){
        // 20221202 ljh DB202211594688  end
@@ -89,9 +126,12 @@
            updateOpp.add(opptemp);
        }
        
        update updateOpp;
        update taskList;
        // 20230508 ljh DB202305008316 start
        // update taskList;
        update Uptask;
        // 20230508 ljh DB202305008316 end
    }
    //2022-6-22 yjk 询价跟进任务 end
@@ -191,11 +231,28 @@
        //20220708 询价任务开发,结束失单任务状态,筛选需要的修改的失单任务 start
        Set<String> oppIdSet = new Set<String>();
        Set<String> passOppIdSet = new Set<String>();
        for (Lost_cancel_report__c n: newList) {
            if ((n.Report_Status__c != oldMap.get(n.Id).Report_Status__c) && n.Report_Status__c == '申请中') {
                oppIdSet.add(n.Opportunity__c);
            }
            if ((n.Report_Status__c != oldMap.get(n.Id).Report_Status__c) && n.Report_Status__c == '批准') {
                passOppIdSet.add(n.Opportunity__c);
            }
        }
        // 20230411 多失单报告合并,取出待合并的询价 start
        Map<String, Opportunity> mapOpps = new Map<String, Opportunity>();
        List<Opportunity> lstOpps = [select Id, RivalHostsNumber__c, CompetitorProduct1__c,
                                        CompetitorProduct2__c, CompetitorProduct3__c, Lost_reason_main__c,
                                        Lost_Reason_Sub__c, Agencies__c, PCLLostBrands__c, of_lost_system_processor__c,
                                        LostPrices__c
                                    from Opportunity
                                    where Id in :passOppIdSet];
        for(Opportunity opp : lstOpps) {
            mapOpps.put(opp.Id, opp);
        }
        System.debug('mapOpps: ' + mapOpps);
        // 20230411 多失单报告合并,取出待合并的询价 end
        // 20220720 ljh add 记录取消/失单报告提交时点的战略产品判断 start
        if(oppIdSet.size() > 0 ){
            List<OpportunityLineItem> OppLIlist = [select Id,Key_product_147P_Text__c,Key_product_147P__c from OpportunityLineItem  where OpportunityId in :oppIdSet];
@@ -204,9 +261,13 @@
            }
            update OppLIlist;
        // 20220720 ljh add 记录取消/失单报告提交时点的战略产品判断 end
            List<task__c> taskList = [select id,taskStatus__c from task__c where RecordType.Name ='失单报告任务' and taskStatus__c = '02 接受' and OpportunityId__c in :oppIdSet];
            List<task__c> taskList = [select id,taskStatus__c
                                      from task__c
                                      where RecordType.Name ='失单报告任务'
                                      and taskStatus__c = '02 接受'
                                      and OpportunityId__c in :oppIdSet];
            for(task__c tsk : taskList){
                tsk.taskStatus__c = '03 完成';
                tsk.taskStatus__c = '03 完成';
            }
            update taskList;
        }// 20220720 ljh update
@@ -214,11 +275,13 @@
        List<PCLLostProduct__c> lcrList=[select id,PCLLostBrand__r.Lost_cancel_report__r.of_lost_system_processor__c,
                                        PCLLostBrand__r.Lost_Reason_Sub__c,PCLLostBrand__r.Lost_cancel_report__r.LostTotalAmount__c,
                                        PCLLostBrand__r.Lost_cancel_report__r.TotalAmountLost__c,   //20230215 lt DB202302247719
                                        PCLLostBrand__r.Lost_cancel_report__r.LostType__c,PCLLostBrand__r.Lost_By_Company__c,
                                        PCLLostBrand__r.Lost_By_Company_Mannual__c,PCLLostBrand__r.LostPrice__c,LostProduct__r.Name, 
                                        PCLLostBrand__r.Lost_reason_main__c,PCLLostBrand__r.Agency__r.Name,PCLLostBrand__r.AgencyMannual__c,
                                        PCLLostBrand__r.Lost_cancel_report__r.Opportunity__r.Name,Opportunity__c, LostProductMannual__c
                                        ,ProductClass__c, Quantity__c   //20220930  lt SWAG-CHL5XA【FY23询价改善】-统计主机台数
                                        ,ProductClass__c
                                        , Quantity__c   //20220930  lt SWAG-CHL5XA【FY23询价改善】-统计主机台数
                                        from PCLLostProduct__c 
                                        where PCLLostBrand__r.Lost_cancel_report__c in : arrMap.keyset()];
        List<Opportunity> oppList=new List<Opportunity>();
@@ -230,25 +293,24 @@
            List<String> ppList=new List<String>();     //失单品牌
            // List<String> yyList=new List<String>();     //失单原因
            //初始化
            Opportunity opp=new Opportunity();
            // 20230411 多失单报告合并,取出待合并的询价 start
            Opportunity opp = mapOpps != null && mapOpps.containsKey(arrMap.get(lcro).Opportunity__c) ? mapOpps.get(arrMap.get(lcro).Opportunity__c) : new Opportunity();
            //20220930  lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 start
            opp.RivalHostsNumber__c = 0;
            System.debug('lt123初始失单主机数'+ opp.RivalHostsNumber__c);
            opp.RivalHostsNumber__c = opp.RivalHostsNumber__c != null ? opp.RivalHostsNumber__c : 0;
            //20220930  lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 end
            opp.Id=arrMap.get(lcro).Opportunity__c; opp.PCLLostBrands__c=''; opp.Agencies__c='';    //Id ,品牌,经销商
            opp.Id = String.isNotBlank(opp.Id) ? opp.Id : arrMap.get(lcro).Opportunity__c;
            opp.PCLLostBrands__c = String.isNotBlank(opp.PCLLostBrands__c) ? opp.PCLLostBrands__c : '';
            opp.Agencies__c = String.isNotBlank(opp.Agencies__c) ? opp.Agencies__c : '';
            System.debug('opp: ' + opp);
            // 20230411 多失单报告合并,取出待合并的询价 end
            // for产品
            for (PCLLostProduct__c lcr : lcrList) {
                System.debug('lt123主机111'+ lcr.ProductClass__c);
                if (opp.Id==lcr.Opportunity__c) {
                    //20220930  lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 start
                    System.debug('lt123主机'+ lcr.ProductClass__c);
                    if(lcr.ProductClass__c == '主机'){
                        opp.RivalHostsNumber__c += lcr.Quantity__c;
                        System.debug('lt123累加失单主机数'+ opp.RivalHostsNumber__c);
                    }else{
                        opp.RivalHostsNumber__c += 0;
                        System.debug('lt123不变失单主机数'+ opp.RivalHostsNumber__c);
                    }
                    //20220930  lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 end
@@ -325,10 +387,21 @@
                    //  }
                    // }
                    //失单总金额
                    opp.LostPrices__c=lcr.PCLLostBrand__r.Lost_cancel_report__r.LostTotalAmount__c;
                    //opp.LostPrices__c=lcr.PCLLostBrand__r.Lost_cancel_report__r.LostTotalAmount__c;//20230215 lt DB202302247719 注释
                    // opp.LostPrices__c=lcr.PCLLostBrand__r.Lost_cancel_report__r.TotalAmountLost__c;   //20230215 lt DB202302247719
                    opp.of_lost_system_processor__c=lcr.PCLLostBrand__r.Lost_cancel_report__r.of_lost_system_processor__c;
                }
            }
            //20230215 lt DB202302247719 start
            if(arrMap.get(lcro).TotalAmountLost__c != null){
                if(opp.LostPrices__c == null){
                    opp.LostPrices__c = 0;
                }
                opp.LostPrices__c+=arrMap.get(lcro).TotalAmountLost__c;
                // System.debug('lt123---opp.LostPrices__c---失单金额2: '+opp.LostPrices__c);
            }
            //20230215 lt DB202302247719 end
            // 20221202 ljh DB202211594688  start
            System.debug('zheli00:'+oppIdPZSet+'~'+opp.Id);
            if(oppIdPZSet.contains(opp.Id)){
@@ -339,7 +412,6 @@
            oppList.add(opp);
        }
        update oppList;
    }
    // tcm 20211126 更新询价信息 end
@@ -352,7 +424,8 @@
        for(Lost_cancel_report__c lcr : newList){
            //筛选出需要提交日有修改的订单
            Lost_cancel_report__c oldLrc = oldMap.get(lcr.Id);
            if((lcr.Report_Status__c != oldMap.get(lcr.Id).Report_Status__c) && lcr.Report_Status__c == '申请中'){      //oldLrc.Submit_Day__c != lcr.Submit_Day__c
            //DB202309191132 紧急调查:修改失单报告失单报告确认时间被更新 lt 20230911 add  && lcr.ModifyAfterApproval_SubmitDay__c == null
            if((lcr.Report_Status__c != oldMap.get(lcr.Id).Report_Status__c) && lcr.Report_Status__c == '申请中' && lcr.ModifyAfterApproval_SubmitDay__c == null){      //oldLrc.Submit_Day__c != lcr.Submit_Day__c
                lostIds.add(lcr.Id);
                oppIds.add(lcr.Opportunity__c);
            }
@@ -398,13 +471,31 @@
        }
        System.debug('oppIds: ' + oppIds);
        if (oppIds.size() > 0) {
            List<Opportunity> opps = [select Id, StageName, Final_Contract_Proceeded_Date__c, Lost_Opportunity_Date__c from Opportunity where Id in :oppIds and StageName in ('敗戦', '削除')];
            System.debug('opps: ' + opps);
            //DB202303237846 lt 20230316 add   , Lost_Cancel_Report__c,Lost_Cancel_Report__r.Report_Status__c,Lost_Cancel_Report__r.LostType__c
            List<Opportunity> opps = [select Id, StageName, Final_Contract_Proceeded_Date__c, Lost_Opportunity_Date__c, Lost_Cancel_Report__c,Lost_Cancel_Report__r.Report_Status__c,Lost_Cancel_Report__r.LostType__c from Opportunity where Id in :oppIds and StageName in ('敗戦', '削除')];
            System.debug('opps: ' + opps);
            //DB202303237846 lt 20230316 start
            Set<String> oppSet = new Set<String>();
            List<Lost_Cancel_Report__c> oppreps = [select Id, Report_Status__c, LostType__c, Opportunity__c from Lost_Cancel_Report__c where Opportunity__c in :opps and Report_Status__c='批准' and LostType__c = '失单'];
            if(oppreps.Size() > 0){
                for(Lost_Cancel_Report__c lcp : oppreps){
                    oppSet.add(lcp.Opportunity__c);
                }
            }
            if (opps.size() > 0) {
                for (Opportunity opp : opps) {
                    opp.StageName = '引合';
                    opp.Final_Contract_Proceeded_Date__c = null;
                    opp.Lost_Opportunity_Date__c = null;
                    if(oppSet.size() > 0 && oppSet.contains(opp.Id)){
                        continue;
                   }else{
                        opp.StageName = '引合';
                        opp.Final_Contract_Proceeded_Date__c = null;
                        opp.Lost_Opportunity_Date__c = null;
                   }
                    // if(opp.Lost_Cancel_Report__c == null || (opp.Lost_Cancel_Report__c != null && (opp.Lost_Cancel_Report__r.Report_Status__c != '批准' || opp.Lost_Cancel_Report__r.LostType__c != '失单'))){
                    // }
            //DB202303237846 lt 20230316 end
                }
                update opps;
            }
@@ -412,4 +503,20 @@
    }
    // 2022-7-29 ssm XLIU-CGSC8R 【委托】[改善】询价里删除批准的失单报告状态1自动变 end
    // 更新营业助理
    private void updateSalesAssistant() {
        Map<String, Opportunity> opps = new Map<String, Opportunity>();
        for (Lost_cancel_report__c report : this.newList) {
            opps.put(report.Opportunity__c, null);
        }
        if (opps != null && opps.size() > 0) {
            List<Opportunity> opplist = [select Id, Sales_assistant_ID__c from Opportunity where Id in :opps.keySet()];
            for (Opportunity opp : opplist) {
                opps.put(opp.Id, opp);
            }
            for (Lost_cancel_report__c report : this.newList) {
                report.Sales_assistant__c = opps.get(report.Opportunity__c) != null ? opps.get(report.Opportunity__c).Sales_assistant_ID__c : report.Sales_assistant__c;
            }
        }
    }
}
force-app/main/default/classes/LostCancelReportHandlerTest.cls
@@ -112,6 +112,12 @@
        depart2.Hospital__c= company1.Id;
        insert depart2;
        Account depart3 = new Account();
        depart3.RecordTypeId = '01210000000Qem1';
        depart3.Name         = '*';
        depart3.Hospital__c         = company1.Id;
        insert depart3;
        // 询价
        Opportunity opp1 = new Opportunity(Name='opp1', StageName='oppName', CloseDate=Date.today(),Hospital__c = company1.Id,Department_Class__c = dc1s[0].Id,AccountId = depart1.Id);
        insert opp1;
@@ -127,14 +133,14 @@
        pcllb1.Lost_Reason_Sub__c='价格';   //原因次
        pcllb1.Lost_reason_main__c='价格';     //原因主
        pcllb1.Lost_By_Company__c='蛇牌';       //品牌(主)
        pcllb1.Agency__c=depart1.Id;            //经销商
        pcllb1.Agency__c=depart3.Id;            //经销商
        pcllb1.Lost_cancel_report__c=lcr1.Id;
        //失单品牌2
        PCLLostBrand__c pcllb2=pcllb1.clone();
        pcllb2.Lost_By_Company__c='其他';       //品牌(主)
        pcllb2.Lost_By_Company_Mannual__c='失单品牌';   //手动品牌
        pcllb2.Agency__c=depart2.Id;            //经销商
        pcllb2.Agency__c=depart3.Id;            //经销商
        pcllb2.AgencyMannual__c='手动经销商';
        insert new List<PCLLostBrand__c> {pcllb1,pcllb2};
@@ -143,13 +149,15 @@
        Product2 pro1 = new Product2(Name='name01', Brand_Name__c='蛇牌',Category5__c='竞争对手',IsActive=true,Family='SP',Fixture_Model_No__c='n01',Serial_Lot_No__c='S/N tracing',Fixture_Model_No_T__c = 'n01',ProductCode_Ext__c='pc01',Manual_Entry__c=false);
        Product2 pro2 = new Product2(Name='name02', Brand_Name__c='其他',Category5__c='竞争对手',IsActive=true,Family='SP2',Fixture_Model_No__c='n02',Serial_Lot_No__c='S/N tracing',Fixture_Model_No_T__c = 'n02',ProductCode_Ext__c='pc02',Manual_Entry__c=false);
        // Product2 pro3 = new Product2(Name='name03',Lost_By_Company__c='其他',IsActive=true,Family='SP3',Fixture_Model_No__c='n03',Serial_Lot_No__c='S/N tracing',Fixture_Model_No_T__c = 'n03',ProductCode_Ext__c='pc03',Manual_Entry__c=false);
         if(NFMUtil.isSandbox()){
                pro1.RecordTypeId = '0129D000001NacD';
                pro2.RecordTypeId = '0129D000001NacD';
            } else {
                pro1.RecordTypeId = '01210000000aMAE';
                pro2.RecordTypeId = '01210000000aMAE';
            }
        //  if(NFMUtil.isSandbox()){
        //         pro1.RecordTypeId = '0129D000001NacD';
        //         pro2.RecordTypeId = '0129D000001NacD';
        //     } else {
        //         pro1.RecordTypeId = '01210000000aMAE';
        //         pro2.RecordTypeId = '01210000000aMAE';
        //     }
        pro1.RecordTypeId = '01210000000aMAE';
        pro2.RecordTypeId = '01210000000aMAE';
        insert new List<Product2> {pro1,pro2};
force-app/main/default/classes/LostCancelReportOppBatchTest.cls
@@ -72,8 +72,8 @@
        insert new List<PCLLostBrand__c> {pcllb1,pcllb2};
        // 产品
        Product2 pro1 = new Product2(Name='name01',Brand_Name__c='蛇牌',Category5__c='竞争对手',IsActive=true,Family='SP',Fixture_Model_No__c='n01',Serial_Lot_No__c='S/N tracing',Fixture_Model_No_T__c = 'n01',ProductCode_Ext__c='pc01',Manual_Entry__c=false);
        Product2 pro2 = new Product2(Name='name02',Brand_Name__c='蛇牌',Category5__c='竞争对手',IsActive=true,Family='SP2',Fixture_Model_No__c='n02',Serial_Lot_No__c='S/N tracing',Fixture_Model_No_T__c = 'n02',ProductCode_Ext__c='pc02',Manual_Entry__c=false);
        Product2 pro1 = new Product2(Name='name01',Brand_Name__c='蛇牌',Category5__c='竞争对手',IsActive=true,Family='SP',Fixture_Model_No__c='n01',Serial_Lot_No__c='S/N tracing',Fixture_Model_No_T__c = 'n01',ProductCode_Ext__c='pc01',Manual_Entry__c=false,RecordTypeId='01210000000aMAE');//正式01210000000aMAE
        Product2 pro2 = new Product2(Name='name02',Brand_Name__c='蛇牌',Category5__c='竞争对手',IsActive=true,Family='SP2',Fixture_Model_No__c='n02',Serial_Lot_No__c='S/N tracing',Fixture_Model_No_T__c = 'n02',ProductCode_Ext__c='pc02',Manual_Entry__c=false,RecordTypeId='01210000000aMAE');//测试0129D000001NacD
        insert new List<Product2> {pro1,pro2};
        //失单型号
force-app/main/default/classes/MaintenanceProductDataController.cls
@@ -68,7 +68,7 @@
    //LJPH-C6A3DF 【委托】 【重要】产品主数据中增加服务用产品分类 liuyan 20210908 Star
    public List<Maintenance_Product_Data_Details__c>  RepairInfo { 
        get {
            return  [select id,Service_Category6__c,Service_Category7__c FROM Maintenance_Product_Data_Details__c  where Default_Fixture_Arrival_Product__c = ''  LIMIT 1 ];
            return  [select id,Service_Category6__c,Service_Category7__c FROM Maintenance_Product_Data_Details__c  where Default_Fixture_Arrival_Product__c = '' and Service_Category6__c = null and Service_Category7__c = null  LIMIT 1 ];
        }
    }
    //LJPH-C6A3DF 【委托】 【重要】产品主数据中增加服务用产品分类 liuyan 20210908 End
@@ -1193,7 +1193,8 @@
    public PageReference returnMpdPage(){
        PageReference ref;
        if(String.isBlank(id)){
            ref = new Pagereference(ApexPages.currentPage().getParameters().get('retURL'));
            // ref = new Pagereference(ApexPages.currentPage().getParameters().get('retURL'));
            ref = new Pagereference('/lightning/o/Maintenance_Product_Data__c/list?filterName=Recent');
        }else{
            ref = new Pagereference('/'+id);
        }
force-app/main/default/classes/OpportunityLightingButtonController.cls
@@ -2,17 +2,9 @@
 * @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:58:57
 * @LastEditTime: 2023-09-25 13:20:57
 */
public with sharing class OpportunityLightingButtonController {
    @AuraEnabled
@@ -29,12 +21,6 @@
            throw new AuraHandledException(e.getMessage());
        }
        return res;
    }
    @AuraEnabled
    public static Id queryForProfileId(){
        return UserInfo.getProfileId();
    }
    @AuraEnabled
    public static InitData initForPredictedDateChangeButton(String recordId){
@@ -279,6 +265,7 @@
                select
                StageName,
                SAP_Send_OK__c,
                Cnt_Lost_cancel_Draft__c,
                Cnt_Lost_cancel_report__c,
                Name,
                Sales_assistant_name__c,
@@ -299,6 +286,7 @@
            res.salesManagerDepartmentID = opportunity.Sales_manager_departmentID__c;
            res.salesOwnerBuchang = opportunity.Sales_owner_buchang__c;
            res.salesOwnerBuchangID = opportunity.Sales_owner_buchangID__c;
            res.cntLostCancelDraft = opportunity.Cnt_Lost_cancel_Draft__c;
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
@@ -810,6 +798,115 @@
        }
    }
    @AuraEnabled
    public static string queryForProfileId(){
        return UserInfo.getProfileId();
    }
    @AuraEnabled
    public static Boolean queryQuote(String estimationId){
        Boolean bo;
        try {
            Quote qu = [select Have_Virtual__c from Quote where Id =: estimationId];
            bo = qu.Have_Virtual__c;
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return bo;
    }
    @AuraEnabled
    public static String initCopy(String recordId){
        String s='';
        try {
            String objectName = 'Opportunity'; // 要获取字段的对象名
            Map<String, Schema.SObjectType> globalDescribe = Schema.getGlobalDescribe();
            Schema.SObjectType objType = globalDescribe.get(objectName);
            if (objType != null) {
                Schema.DescribeSObjectResult objDescribe = objType.getDescribe();
                Map<String, Schema.SObjectField> fieldMap = objDescribe.fields.getMap();
                s+='SELECT ';
                // 现在,fieldMap中包含了对象的所有字段信息
                for (String fieldName : fieldMap.keySet()) {
                    if(!fieldName.equals('id')
                        &&!fieldName.equals('Id') &&!fieldName.equals('Opportunity_No__c'))
                        s+=fieldName+',';
                }
                s=s.removeEnd(',');
                s+=' FROM Opportunity where id=\''+recordId+'\'';
                system.debug('SQL:'+s);
                List<Opportunity> opportunitys = Database.query(s);
                s='';
                if(opportunitys.size()>0){
                    system.debug('in!');
                    for (String fieldName : fieldMap.keySet()) {
                        String formaF=fieldMap.get(fieldName).getDescribe().getName();
                        if(opportunitys.get(0).get(fieldName)!=null&&!opportunitys.get(0).get(fieldName).equals('null')){
                            if(formaF.equals('Id')
                                ||formaF.equals('OwnerId')
                                ||formaF.equals('CreatedDate')
                                ||formaF.equals('CreatedById')
                                )
                            {
                                continue;
                            }
                            Object val=opportunitys.get(0).get(fieldName);
                            if(val instanceof Date ){
                                String str=String.valueOf(val);
                                str=str.replace(' ','T');
                                str+='.000Z';
                                s+=formaF+'='+str+',';
                            }else if (val instanceof DateTime){
                                String str=String.valueOf(val);
                                str=str.replace(' ','T');
                                str+='.000Z';
                                s+=formaF+'='+str+',';
                            }else{
                                s+=formaF+'='+opportunitys.get(0).get(fieldName)+',';
                            }
                        }
                    }
                    s=s.removeEnd(',');
                    return s;
                }
            }
            return s;
        } catch (Exception e) {
            System.debug(e.getMessage());
        }
        return s;
    }
    public static String forma(String str){
        String res='';
        String stra='a';
        Integer a=stra.charAt(0);
        String strz='z';
        Integer z=strz.charAt(0);
        String strAa='A';
        Integer bA=strAa.charAt(0);
        String strZz='Z';
        Integer bZ=strZz.charAt(0);
        String strx='_';
        Integer x=strx.charAt(0);
        List<Integer> charArr = new List<Integer>();
        Integer change=bA-a;
        Integer st=(str.charAt(0)+change);
        charArr.add(st);
        for(Integer i=0;i<str.length()-2;i++){
            Integer c=str.charAt(i);
            Integer nextC=str.charAt(i+1);
            if(c==x&&nextC>=a&&nextC<z&&i!=str.length()-2){
                nextC+=change;
            }
            charArr.add(nextC);
        }
        res=String.fromCharArray(charArr);
        res+=str.substring(str.length()-1,str.length());
        return res;
    }
    @AuraEnabled
    public static String changeTrade(String oppId){
        List<Quote> quoList = [select id from Quote where OpportunityId = :oppId];
force-app/main/default/classes/PCLLostReportController.cls
@@ -147,11 +147,11 @@
          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
            ProductCategory__c,
            ProductClass__c, //add tcm 20211123
            Quantity__c,Name, LostBrandName__c 
            from PCLLostBrand__c.PCLLostBrandProduct__r)
          from PCLLostBrand__c
@@ -261,8 +261,6 @@
          // 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;
        }
      }
@@ -714,7 +712,9 @@
        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];
        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;
force-app/main/default/classes/Product2Handler.cls
@@ -32,6 +32,7 @@
    //SFDC停止预警  lt  20210922 add start
    protected override void afterUpdate(){
        Calculate_AverageMonthSales(this.newList, this.oldMap);
        AssignmentUltrasonic(this.newList, this.oldMap);  //20230506 lt DB202304618804  包含超声 add
    }
    //SFDC停止预警  lt  20210922 add end
@@ -70,10 +71,12 @@
                strPC = String.valueof(proList[0].get('PC'));
            }
            //带量采购 start fy
            proListsc = [Select Max(ProductCode) PC From Product2 Where ProductCode Like 'SC%'];
            if (proListsc != null && proListsc.size() > 0) {
                strPCsc = String.valueof(proListsc[0].get('PC'));
            }
            // proListsc = [Select Max(ProductCode) PC From Product2 Where ProductCode Like 'SC%'];
            // if (proListsc != null && proListsc.size() > 0) {
            //     strPCsc = String.valueof(proListsc[0].get('PC'));
            // }
            List<Product2> lastPro = [select Id,ProductCode from Product2 where ProductCode Like 'SC%' order by ProductCode desc limit 1];
            strPCsc = lastPro != null && lastPro.size() > 0 ? lastPro[0].ProductCode : '';
            //带量采购 end fy
        }
        for (Product2 nObj : newList) {
@@ -127,11 +130,21 @@
                                    Service_Category6__c,Service_Category7__c,
                                    Can_Repair__c,RepairListPriceLevelA__c,
                                    RepairListPriceLevelB__c,RepairListPriceLevelC__c,
                                    PartSupplyFinishDate__c,EndSaleDate__c,ProductClass__c,ProductCategory__c,
                                    PartSupplyFinishDate__c,EndSaleDate__c,
                                    ProductClass__c,
                                    ProductCategory__c,
                                    Period_Filter_Classify1__c,Period_Filter_Classify2__c,Period_Filter_Classify3__c,
                                    Intra_Trade_Service_RMB_Date1__c,Intra_Trade_Service_RMB_Date2__c,
                                    Intra_Trade_Service_RMB_EndDate1__c,Intra_Trade_Service_RMB_EndDate2__c,
                                    Intra_Trade_Service_RMB_1__c,Intra_Trade_Service_RMB_2__c
                                    Intra_Trade_Service_RMB_1__c,Intra_Trade_Service_RMB_2__c,
                                    // 新增多年保修计提  WYL 2023/08/21 start
                                    Intra_Trade_Gurantee_RMB_1__c,
                                    Intra_Trade_Gurantee_RMB_2__c,
                                    Intra_Trade_Gurantee_RMB_Date1__c,
                                    Intra_Trade_Gurantee_RMB_Date2__c,
                                    Intra_Trade_Gurantee_RMB_End_Date1__c,
                                    Intra_Trade_Gurantee_RMB_End_Date2__c
                                     // 新增多年保修计提  WYL 2023/08/21 end
                                    from Product2
                                    where Asset_Model_No__c in :noNewList
                                    order by CreatedDate desc];
@@ -186,6 +199,14 @@
                    prd.Intra_Trade_Service_RMB_EndDate2__c = prdMap.get(prd.Asset_Model_No__c).Intra_Trade_Service_RMB_EndDate2__c;//多年保价格有效结束日2
                    prd.Intra_Trade_Service_RMB_1__c = prdMap.get(prd.Asset_Model_No__c).Intra_Trade_Service_RMB_1__c;//多年保价格1
                    prd.Intra_Trade_Service_RMB_2__c = prdMap.get(prd.Asset_Model_No__c).Intra_Trade_Service_RMB_2__c;//多年保价格2
                   // 新增多年保修计提  WYL 2023/08/21 start
                   prd.Intra_Trade_Gurantee_RMB_1__c = prdMap.get(prd.Asset_Model_No__c).Intra_Trade_Gurantee_RMB_1__c;//多年保修计提价格1
                   prd.Intra_Trade_Gurantee_RMB_2__c = prdMap.get(prd.Asset_Model_No__c).Intra_Trade_Gurantee_RMB_2__c;//多年保修计提价格2
                   prd.Intra_Trade_Gurantee_RMB_Date1__c = prdMap.get(prd.Asset_Model_No__c).Intra_Trade_Gurantee_RMB_Date1__c;//多年保修计提价格有效开始日1
                   prd.Intra_Trade_Gurantee_RMB_Date2__c = prdMap.get(prd.Asset_Model_No__c).Intra_Trade_Gurantee_RMB_Date2__c;//多年保修计提价格有效开始日2
                   prd.Intra_Trade_Gurantee_RMB_End_Date1__c = prdMap.get(prd.Asset_Model_No__c).Intra_Trade_Gurantee_RMB_End_Date1__c;//多年保修计提价格有效结束日1
                   prd.Intra_Trade_Gurantee_RMB_End_Date2__c = prdMap.get(prd.Asset_Model_No__c).Intra_Trade_Gurantee_RMB_End_Date2__c;//多年保修计提价格有效结束日2
                    // 新增多年保修计提  WYL 2023/08/21 end
                }
            }
        }
@@ -466,4 +487,33 @@
        }
    }
    //20230506 lt DB202304618804  包含超声 start
    private static void AssignmentUltrasonic(List<Product2> newList,Map<Id, Product2> oldMap){
        List<String> proIdList = new List<String>();
        List<PCLLostProduct__c> updateplpList = new List<PCLLostProduct__c>();
        for(Product2 pro : newList){
            if(pro.RecordTypeId == System.Label.Pro_RecordType &&
            (pro.Lost_Product_Differ__c != oldMap.get(pro.Id).Lost_Product_Differ__c ||
            pro.Lost_Product_Category__c != oldMap.get(pro.Id).Lost_Product_Category__c)){
                proIdList.add(pro.Id);
            }
        }
        List<PCLLostProduct__c> plpList = [Select Id, LostProduct__c, ProductClass__c, ProductCategory__c
                                           From PCLLostProduct__c
                                           Where LostProduct__c in: proIdList ];
        if(plpList.size() > 0 ){
            for(PCLLostProduct__c plp : plpList){
                plp.ProductClass__c = '主机';
                plp.ProductCategory__c = '超声主机';
                updateplpList.add(plp);
            }
        }
        update updateplpList;
    }
    //20230506 lt DB202304618804  包含超声 end
}
force-app/main/default/classes/RentalApplyFaultHandler.cls
New file
@@ -0,0 +1,569 @@
public without sharing class RentalApplyFaultHandler extends Oly_TriggerHandler {
    private Map<Id, Rental_Apply_Fault__c> newMap;
    private Map<Id, Rental_Apply_Fault__c> oldMap;
    private List<Rental_Apply_Fault__c> newList;
    private List<Rental_Apply_Fault__c> oldList;
    public RentalApplyFaultHandler(){
        this.newMap =  (Map<Id, Rental_Apply_Fault__c>) Trigger.newMap;
        this.oldMap =  (Map<Id, Rental_Apply_Fault__c>) Trigger.oldMap;
        this.newList = (List<Rental_Apply_Fault__c>) Trigger.new;
        this.oldList = (List<Rental_Apply_Fault__c>) Trigger.old;
    }
    protected override void beforeInsert() {
        //List 备品借出申请
        List<String> raListIds = new List<String>();
        Set<String> radListIds = new Set<String>();
        //申请单Id, List<故障报告>
        Map<Id, List<Rental_Apply_Fault__c>> raMap = new Map<Id, List<Rental_Apply_Fault__c>>();
        //Name 规则 : 备品借出申请单 + 001 ~999
        for(Rental_Apply_Fault__c raf: newList){
            //获取所有的申请单Id
            radListIds.add(raf.Rental_Apply_Equipment_Set_Detail__c);
        }
        // 获取申请单下所有明细的Id
        List<Rental_Apply_Equipment_Set_Detail__c> raesdList = [SELECT Id,Rental_Apply__c from Rental_Apply_Equipment_Set_Detail__c WHERE Id in :radListIds];
        for(Rental_Apply_Equipment_Set_Detail__c rae : raesdList){
            raListIds.add(rae.Rental_Apply__c);
        }
        raesdList = [SELECT Id,Rental_Apply__c from Rental_Apply_Equipment_Set_Detail__c WHERE Rental_Apply__c in :raListIds];
        for(Rental_Apply_Equipment_Set_Detail__c rea : raesdList){
            radListIds.add(rea.Id);
        }
        system.debug('radListIds===='+radListIds);
        //查出 申请单下全部的检测报告
        List<Rental_Apply_Fault__c> raList = [SELECT Id, Rental_Apply_Equipment_Set_Detail__c, Rental_Apply_Equipment_Set_Detail__r.Rental_Apply__r.Id,Rental_Apply_Equipment_Set_Detail__r.Rental_Apply__r.Name from Rental_Apply_Fault__c where Rental_Apply_Equipment_Set_Detail__c in :radListIds];
        //查出 所有申请单明细
        Map<Id,Rental_Apply_Equipment_Set_Detail__c> radMap = new Map<Id,Rental_Apply_Equipment_Set_Detail__c>([
                Select Id,Rental_Apply__r.Name, Rental_Apply__r.Id, Rental_Apply__r.Person_In_Charge__c, Rental_Apply__r.demo_purpose2__c,
                        Rental_Apply__r.Rental_Assistant__c, Rental_Apply__r.Rental_Assistant2__c, Rental_Apply__r.Loaner_Storage_mail_address__c,
                        Rental_Apply__r.ZongjianApprovalManager__c, Rental_Apply__r.BuchangApprovalManagerSales__c, SerialNumber_F__c,
                        Rental_Apply__r.SalesManager__c, Rental_Apply__r.Loaner_centre_mail_address__c, Rental_Apply__r.Hospital__r.Name,
                        Fixture_Model_No__c, Rental_Apply__r.OCM_dept_category__c, Rental_Apply__r.WorkPlace__c, (select id from Rental_Apply_Equipment_Set_Detail_Fault__r)
                from Rental_Apply_Equipment_Set_Detail__c
                where id in :radListIds]);
        system.debug('radMap===='+radMap);
        for (Rental_Apply_Fault__c raf : raList) {
            system.debug('raf.Rental_Apply_Equipment_Set_Detail__c==='+raf.Rental_Apply_Equipment_Set_Detail__c);
            system.debug('radMap.get(raf.Rental_Apply_Equipment_Set_Detail__c).Rental_Apply__r.Id===' + radMap.get(raf.Rental_Apply_Equipment_Set_Detail__c).Rental_Apply__r.Id);
            if(raMap.containsKey(radMap.get(raf.Rental_Apply_Equipment_Set_Detail__c).Rental_Apply__r.Id)){
                raMap.get(radMap.get(raf.Rental_Apply_Equipment_Set_Detail__c).Rental_Apply__r.Id).add(raf);
            } else {
                List<Rental_Apply_Fault__c> tempList = new List<Rental_Apply_Fault__c>();
                tempList.add(raf);
                raMap.put(radMap.get(raf.Rental_Apply_Equipment_Set_Detail__c).Rental_Apply__r.Id,tempList);
            }
        }
        system.debug('raMap===='+raMap);
        for(Rental_Apply_Fault__c raf : newList){
            //当前借出明细Id
            String radId = raf.Rental_Apply_Equipment_Set_Detail__c;
            //当前申请单Id
            String raId = radMap.get(radId).Rental_Apply__r.Id;
            if( radMap.containsKey(raf.Rental_Apply_Equipment_Set_Detail__c) && radMap.get(raf.Rental_Apply_Equipment_Set_Detail__c).Rental_Apply_Equipment_Set_Detail_Fault__r.size() >= 1 ){
                raf.addError('已存在检测分析报告');
            }
            if(raMap.containsKey(raId)){
                Integer rafSize = raMap.get(raId).size() + 1;
                system.debug('rafSize===='+rafSize);
                String rafSizeString = '000' + rafSize;
                String cutString = rafSizeString.substring(rafSizeString.length()-3, rafSizeString.length());
                if(rafSize == 0) {
                    raf.Name = radMap.get(radId).Rental_Apply__r.Name + '-JCBG-001';
                }else{
                    raf.Name = radMap.get(radId).Rental_Apply__r.Name + '-JCBG-' + cutString;
                }
            }else{
                raf.Name = radMap.get(radId).Rental_Apply__r.Name + '-JCBG-001';
            }
            raf.RentalApplyNo__c = radMap.get(radId).Rental_Apply__r.Name;
            raf.demo_purpose2__c = radMap.get(radId).Rental_Apply__r.demo_purpose2__c;
            raf.HospitalText__c = radMap.get(radId).Rental_Apply__r.Hospital__r.Name;
            raf.Repair_product_body_number__c = radMap.get(radId).SerialNumber_F__c;
            raf.Fixture_Model_No__c = radMap.get(radId).Fixture_Model_No__c;
            raf.OCM_dept_category__c = radMap.get(radId).Rental_Apply__r.OCM_dept_category__c;
            raf.WorkPlace__c = radMap.get(radId).Rental_Apply__r.WorkPlace__c;
            raf.Person_In_Charge_User__c = radMap.get(radId).Rental_Apply__r.Person_In_Charge__c;
            raf.Rental_Assistant__c = radMap.get(radId).Rental_Apply__r.Rental_Assistant__c;
            raf.Rental_Assistant2__c = radMap.get(radId).Rental_Apply__r.Rental_Assistant2__c;
            raf.ZongjianApprovalManager__c = radMap.get(radId).Rental_Apply__r.ZongjianApprovalManager__c;
            raf.BuchangApprovalManagerSales__c = radMap.get(radId).Rental_Apply__r.BuchangApprovalManagerSales__c;
            raf.SalesManager__c = radMap.get(radId).Rental_Apply__r.SalesManager__c;
            raf.Loaner_centre_mail_address__c = radMap.get(radId).Rental_Apply__r.Loaner_centre_mail_address__c;
            raf.Loaner_Storage_mail_address__c = radMap.get(radId).Rental_Apply__r.Loaner_Storage_mail_address__c;
            raf.status__c = '草案中';
        }
    }
    protected override void afterInsert() {
        // 给备品出借担当增加读写权限
        List<Rental_Apply_Fault__Share> rafShareList = new List<Rental_Apply_Fault__Share>();
        for (Rental_Apply_Fault__c raf: newList) {
            // 备品出借担当
            if (raf.Person_In_Charge_User__c != null) {
                Rental_Apply_Fault__Share rafShare = new Rental_Apply_Fault__Share();
                rafShare.AccessLevel = 'Edit';
                rafShare.UserOrGroupId = raf.Person_In_Charge_User__c;
                rafShare.ParentID = raf.Id;
                rafShareList.add(rafShare);
            }
            Rental_Apply_Fault__c tempRaf = [select id, ZongjianApprovalManager__r.isActive, BuchangApprovalManagerSales__r.isActive, SalesManager__r.isActive from Rental_Apply_Fault__c where Id =:raf.id ];
            System.debug('-------------temp.ZongjianApprovalManager__r.isActive-------------' + tempRaf.ZongjianApprovalManager__r.isActive);
            System.debug('-------------raf.ZongjianApprovalManager__r.isActive--------------' + raf.ZongjianApprovalManager__r.isActive);
            // CL4 高级总监
            if (raf.ZongjianApprovalManager__c != null && tempRaf.ZongjianApprovalManager__r.isActive) {
                Rental_Apply_Fault__Share rafShare = new Rental_Apply_Fault__Share();
                rafShare.AccessLevel = 'READ';
                rafShare.UserOrGroupId = raf.ZongjianApprovalManager__c;
                rafShare.ParentID = raf.Id;
                rafShareList.add(rafShare);
            }
            // CL5 总监级
            if (raf.BuchangApprovalManagerSales__c != null && tempRaf.BuchangApprovalManagerSales__r.isActive) {
                Rental_Apply_Fault__Share rafShare = new Rental_Apply_Fault__Share();
                rafShare.AccessLevel = 'READ';
                rafShare.UserOrGroupId = raf.BuchangApprovalManagerSales__c;
                rafShare.ParentID = raf.Id;
                rafShareList.add(rafShare);
            }
            // CL6 经理级
            if (raf.SalesManager__c != null && tempRaf.SalesManager__r.isActive) {
                Rental_Apply_Fault__Share rafShare = new Rental_Apply_Fault__Share();
                rafShare.AccessLevel = 'READ';
                rafShare.UserOrGroupId = raf.SalesManager__c;
                rafShare.ParentID = raf.Id;
                rafShareList.add(rafShare);
            }
        }
        if (!rafShareList.isEmpty()) {
            insert rafShareList;
        }
    }
    protected override void beforeUpdate() {
        Date today = Date.today();
        List<Rental_Apply_Fault__c> deleteAttachmentIds = new List<Rental_Apply_Fault__c>();
        Set<Id> deleteIds = new Set<Id>();
        for(Rental_Apply_Fault__c raf: newList){
            Rental_Apply_Fault__c oldRaf = oldMap.get(raf.Id);
            if (raf.status__c == '已发送' && oldRaf.status__c != '已发送') {
                raf.SendDate__c = today;
            }
            if (raf.status__c == '已反馈' && oldRaf.status__c != '已反馈') {
                raf.LoanerFeedback_date__c = today;
                if (raf.UseExplain__c == null) {
                    raf.adderror('【备品使用情况说明】不能为空');
                    return;
                }
            }
            if ((String.isBlank(raf.AttachmentId1__c) && !String.isBlank(oldRaf.AttachmentId1__c))
                || (String.isBlank(raf.AttachmentId2__c) && !String.isBlank(oldRaf.AttachmentId2__c))) {
                deleteAttachmentIds.add(raf);
                if (String.isBlank(raf.AttachmentId1__c) && !String.isBlank(oldRaf.AttachmentId1__c)) {
                    deleteIds.add(oldRaf.AttachmentId1__c);
                }
                if (String.isBlank(raf.AttachmentId2__c) && !String.isBlank(oldRaf.AttachmentId2__c)) {
                    deleteIds.add(oldRaf.AttachmentId2__c);
                }
            }
        }
        if (!deleteAttachmentIds.isEmpty()) {
            // List<Attachment> attList = [SELECT Id,ParentId FROM Attachment WHERE ParentId IN: deleteAttachmentIds Order by ParentId,Id];
            // Map<String, List<Attachment>> parentMap = new Map<String, List<Attachment>>();
            // for (Attachment att : attList) {
            //     if (!deleteIds.contains(att.Id)) {
            //         if (!parentMap.isEmpty() && parentMap.containskey(att.ParentId)) {
            //             List<Attachment> attTemp = parentMap.get(att.ParentId);
            //             attTemp.add(att);
            //             parentMap.put(att.ParentId, attTemp);
            //         } else {
            //             List<Attachment> attTemp = new List<Attachment>();
            //             attTemp.add(att);
            //             parentMap.put(att.ParentId, attTemp);
            //         }
            //     }
            // }
            List<Id> reList = new List<Id>();
            for(Rental_Apply_Fault__c  re: deleteAttachmentIds){
                reList.add(re.Id);
            }
            List<ContentDocumentLink> linkId = [SELECT ContentDocumentId,LinkedEntityId FROM ContentDocumentLink WHERE LinkedEntityId IN: reList Order by LinkedEntityId];
            List<Id> idList = new List<Id>();
            for (ContentDocumentLink link : linkId) {
                idList.add(link.ContentDocumentId);
            }
            Map<String, List<ContentVersion>> parentMap = new Map<String, List<ContentVersion>>();
            List<ContentVersion> versionList = [SELECT ContentDocumentId,Id FROM ContentVersion where ContentDocumentId in: idList];
            Map<String,ContentVersion> shareMap = new Map<String,ContentVersion>();
            for (ContentVersion version : versionList) {
                for(ContentDocumentLink link: linkId){
                    System.debug('conId  ' + link.ContentDocumentId);
                    System.debug('verId  ' + version.ContentDocumentId);
                    if(link.ContentDocumentId == version.ContentDocumentId){
                        shareMap.put(link.ContentDocumentId,version);
                    }
                }
            }
            for (ContentDocumentLink link : linkId) {
                if (!deleteIds.contains(link.ContentDocumentId)) {
                    if (!parentMap.isEmpty() && parentMap.containskey(link.LinkedEntityId)) {
                        List<ContentVersion> linkTemp = parentMap.get(link.LinkedEntityId);
                        linkTemp.add(shareMap.get(link.ContentDocumentId));
                        parentMap.put(link.LinkedEntityId, linkTemp);
                    } else {
                        List<ContentVersion> linkTemp = new List<ContentVersion>();
                        linkTemp.add(shareMap.get(link.ContentDocumentId));
                        parentMap.put(link.LinkedEntityId, linkTemp);
                    }
                }
            }
            for (Rental_Apply_Fault__c raf : deleteAttachmentIds) {
                if (!parentMap.isEmpty() && parentMap.containskey(raf.Id)) {
                    Rental_Apply_Fault__c oldObj = oldMap.get(raf.Id);
                    System.debug('oldObj' + oldObj);
                    // List<Attachment> attTemp = parentMap.get(raf.Id);
                    List<ContentVersion> cVersionTemp = parentMap.get(raf.Id);
                    System.debug('cVersionTemp' + cVersionTemp);
                    for(Integer i = 0;i < cVersionTemp.size();i++){
                        System.debug('attId1:' + raf.AttachmentId1__c);
                        System.debug('attId2:' + raf.AttachmentId2__c);
                        System.debug('oldattId1:' + oldObj.AttachmentId1__c);
                        System.debug('oldattId2:' + oldObj.AttachmentId2__c);
                        if(oldObj.AttachmentId1__c == cVersionTemp[i].Id && raf.AttachmentId1__c == null){
                            System.debug('123456:' + cVersionTemp[i].Id);
                            cVersionTemp.remove(i);
                        }else if(oldObj.AttachmentId2__c == cVersionTemp[i].Id && raf.AttachmentId2__c == null){
                            System.debug('123456:' + cVersionTemp[i].Id);
                            cVersionTemp.remove(i);
                        }
                    }
                    System.debug('========================================' + cVersionTemp);
                    if(cVersionTemp.size() == 0){
                    }else if (cVersionTemp.size() == 1) {
                        // raf.AttachmentId1__c = attTemp[0].Id;
                        raf.AttachmentId1__c = cVersionTemp[0].Id;
                        raf.AttachmentId2__c = null;
                    } else {
                        // raf.AttachmentId1__c = attTemp[0].Id;
                        // raf.AttachmentId2__c = attTemp[1].Id;
                        raf.AttachmentId1__c = cVersionTemp[0].Id;
                        raf.AttachmentId2__c = cVersionTemp[1].Id;
                    }
                }
            }
        }
    }
    protected override void afterUpdate() {
        Set<Id> feedbackIds = new Set<Id>();
        Set<Id> sendReportIds = new Set<Id>();
        for(Rental_Apply_Fault__c raf: newList){
            Rental_Apply_Fault__c oldRaf = oldMap.get(raf.Id);
            if (raf.status__c == '已发送' && oldRaf.status__c != '已发送') {
                sendReportIds.add(raf.Id);
            }
            if (raf.status__c == '已反馈' && oldRaf.status__c != '已反馈') {
                feedbackIds.add(raf.Id);
            }
        }
        if (!sendReportIds.isEmpty()) {
            //备品中心推送邮件给现场
            sendEmail(sendReportIds, '1');
        }
        if (!feedbackIds.isEmpty()) {
            //现场回复后推送的邮件
            sendEmail(feedbackIds, '2');
        }
    }
    //推送邮件处理
    public void sendEmail(Set<Id> rafIds, String flag) {
        List<Rental_Apply_Fault__c> rafList = [
                SELECT Id, Person_In_Charge_User__r.Email, Owner.Email, Rental_Assistant__r.Email, Rental_Assistant2__r.Email,
                        Loaner_centre_mail_address__c, Loaner_Storage_mail_address__c, ZongjianApprovalManager__r.Email,
                        BuchangApprovalManagerSales__r.Email, SalesManager__r.Email, Salesdept__c, StorageCheckEmail__c
                FROM Rental_Apply_Fault__c
                WHERE Id IN: rafIds];
        EmailTemplate et = null;
        if (flag == '1') {
            et = [Select id from EmailTemplate where name = '备品检测分析报告' limit 1];
        } else if (flag == '2') {
            et = [Select id from EmailTemplate where name = '备品检测分析报告操作不当提醒已回复' limit 1];
        } else {
            return;
        }
        List<Messaging.SingleEmailMessage> emails = new List<Messaging.SingleEmailMessage>();
        for (Rental_Apply_Fault__c raf : rafList) {
            String[] toAddresses = new String[]{};
            String[] ccAddresses = new String[]{};
            if (flag == '1') {
                //7月31日演示注释 start
                //To 申请人
                //toAddresses.add(raf.Person_In_Charge_User__r.Email);
                //To 备品跟进助理
                // if(raf.Rental_Assistant__r.Email != null) {
                //     toAddresses.add(raf.Rental_Assistant__r.Email);
                // }
                // if(raf.Rental_Assistant2__r.Email != null){
                //     toAddresses.add(raf.Rental_Assistant2__r.Email);
                // }
                //CC   部外 备品审批流人员及所属总监---cl4总监邮箱 备品总窗口
                //部内 白总、古部长,林部长   白科,古芳丽,林芳
                //     ocmasset公共邮箱
                //     检测仓库公共邮箱
                //ccAddresses = System.Label.RentalApplyFaultReplyToBuNei.split(';');
                //cc 部外 备品审批流人员及所属总监---cl4总监邮箱  备品总窗口
                //setEmailAddress(raf, ccAddresses);
                //7月31日演示注释 end
                if(raf.Loaner_Storage_mail_address__c!=null){
                    ccAddresses.add(raf.Loaner_Storage_mail_address__c);
                }
                ccAddresses.add(raf.Loaner_centre_mail_address__c);
                ccAddresses.add('sunxia@prec-tech.com');
                toAddresses.add('lijinghuan@prec-tech.com');
                //ccAddresses.add(raf.StorageCheckEmail__c);
            } else if (flag == '2') {
                //To ocmasset公共邮箱 检测仓库公共邮箱 检测担当
                //7月31日演示注释 start
                // toAddresses.add(raf.Loaner_centre_mail_address__c);
                // toAddresses.add(raf.Loaner_Storage_mail_address__c);
                // //toAddresses.add(raf.StorageCheckEmail__c);
                // toAddresses.add(raf.Owner.Email);
                //部内  白总、古部长,林部长
                //ccAddresses = System.Label.RentalApplyFaultReplyToBuNei.split(';');
                //cc 部外 备品审批流人员及所属总监---cl4总监邮箱  备品总窗口
                //setEmailAddress(raf, ccAddresses);
                //7月31日演示注释 end
                ccAddresses.add('sunxia@prec-tech.com');
                toAddresses.add('lijinghuan@prec-tech.com');
                //Cc 备品跟进助理
                /*if(raf.Rental_Assistant__r.Email != null) {
                    ccAddresses.add(raf.Rental_Assistant__r.Email);
                }
                if(raf.Rental_Assistant2__r.Email != null){
                    ccAddresses.add(raf.Rental_Assistant2__r.Email);
                }*/
            }
            Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
            mail = Messaging.renderStoredEmailTemplate(et.Id, null, raf.Id);
            mail.setSaveAsActivity(false);
            mail.setToAddresses(toAddresses);
            System.debug('=============' + ccAddresses);
            mail.setCcAddresses(ccAddresses);
            emails.add(mail);
        }
        Messaging.sendEmail(emails);
    }
    public void setEmailAddress(Rental_Apply_Fault__c rafObj, String[] ccAddr) {
        //本部                窗口    CL5总监(备品审批) CL4高级总监(备品审批)   建议抄送人1  建议抄送人2  备注
        //华北                赵靖苹  是                  否                      慕海霞       李鸷
        //东北                关贝妮  是                  否                      赵志成       李鸷
        //西北                张媛媛  是                  否                      颜大庆       宋琰
        //西南                赵雯雯  是                  是
        //华东                徐明楠  是                  否                      宋真         杨剑清
        //华南                夏俊洁  是                  是                      俞澜         严蕊芳
        //MA                  无     是                  否                       陆吉
        //SOLUTION            殷佳骊  是                  否
        //医疗服务本部         无      是                                         陆吉(理论上没有)
        //外科事业本部         李海红  是                  否
        //市场企划本部         无      是                                         陆吉(理论上没有)
        //消化.呼吸内镜事业本部 无      是                 否                      陆吉
        //消化.呼吸领域解决方案本部   无   是                                      陆吉(理论上没有)
        if (rafObj.Salesdept__c == '医疗华北营业本部') {
            if (rafObj.BuchangApprovalManagerSales__c != null) {
                ccAddr.add(rafObj.BuchangApprovalManagerSales__r.Email);
            }
            if (rafObj.SalesManager__c != null) {
                ccAddr.add(rafObj.SalesManager__r.Email);
            }
            if (!String.isBlank(System.Label.RentalApplyFaultReplyTo_Huabei) && System.Label.RentalApplyFaultReplyTo_Huabei != 'null') {
                ccAddr.addAll(System.Label.RentalApplyFaultReplyTo_Huabei.split(';'));
            }
        } else if (rafObj.Salesdept__c == '医疗东北营业本部') {
            if (rafObj.BuchangApprovalManagerSales__c != null) {
                ccAddr.add(rafObj.BuchangApprovalManagerSales__r.Email);
            }
            if (rafObj.SalesManager__c != null) {
                ccAddr.add(rafObj.SalesManager__r.Email);
            }
            if (!String.isBlank(System.Label.RentalApplyFaultReplyTo_Dongbei) && System.Label.RentalApplyFaultReplyTo_Dongbei != 'null') {
                ccAddr.addAll(System.Label.RentalApplyFaultReplyTo_Dongbei.split(';'));
            }
        } else if (rafObj.Salesdept__c == '医疗西北营业本部') {
            if (rafObj.BuchangApprovalManagerSales__c != null) {
                ccAddr.add(rafObj.BuchangApprovalManagerSales__r.Email);
            }
            if (rafObj.SalesManager__c != null) {
                ccAddr.add(rafObj.SalesManager__r.Email);
            }
            if (!String.isBlank(System.Label.RentalApplyFaultReplyTo_Xibei) && System.Label.RentalApplyFaultReplyTo_Xibei != 'null') {
                ccAddr.addAll(System.Label.RentalApplyFaultReplyTo_Xibei.split(';'));
            }
        } else if (rafObj.Salesdept__c == '医疗西南营业本部') {
            if (rafObj.BuchangApprovalManagerSales__c != null) {
                ccAddr.add(rafObj.BuchangApprovalManagerSales__r.Email);
            }
            if (rafObj.SalesManager__c != null) {
                ccAddr.add(rafObj.SalesManager__r.Email);
            }
            if (rafObj.ZongjianApprovalManager__c != null) {
                ccAddr.add(rafObj.ZongjianApprovalManager__r.Email);
            }
            if (!String.isBlank(System.Label.RentalApplyFaultReplyTo_Xinan) && System.Label.RentalApplyFaultReplyTo_Xinan != 'null') {
                ccAddr.addAll(System.Label.RentalApplyFaultReplyTo_Xinan.split(';'));
            }
        } else if (rafObj.Salesdept__c == '医疗华东营业本部') {
            if (rafObj.BuchangApprovalManagerSales__c != null) {
                ccAddr.add(rafObj.BuchangApprovalManagerSales__r.Email);
            }
            if (rafObj.SalesManager__c != null) {
                ccAddr.add(rafObj.SalesManager__r.Email);
            }
            if (!String.isBlank(System.Label.RentalApplyFaultReplyTo_Huadong) && System.Label.RentalApplyFaultReplyTo_Huadong != 'null') {
                ccAddr.addAll(System.Label.RentalApplyFaultReplyTo_Huadong.split(';'));
            }
        } else if (rafObj.Salesdept__c == '医疗华南营业本部') {
            if (rafObj.BuchangApprovalManagerSales__c != null) {
                ccAddr.add(rafObj.BuchangApprovalManagerSales__r.Email);
            }
            if (rafObj.SalesManager__c != null) {
                ccAddr.add(rafObj.SalesManager__r.Email);
            }
            if (rafObj.ZongjianApprovalManager__c != null) {
                ccAddr.add(rafObj.ZongjianApprovalManager__r.Email);
            }
            if (!String.isBlank(System.Label.RentalApplyFaultReplyTo_Huanan) && System.Label.RentalApplyFaultReplyTo_Huanan != 'null') {
                ccAddr.addAll(System.Label.RentalApplyFaultReplyTo_Huanan.split(';'));
            }
        } else if (rafObj.Salesdept__c == 'MA本部') {
            if (rafObj.BuchangApprovalManagerSales__c != null) {
                ccAddr.add(rafObj.BuchangApprovalManagerSales__r.Email);
            }
            if (rafObj.SalesManager__c != null) {
                ccAddr.add(rafObj.SalesManager__r.Email);
            }
            if (!String.isBlank(System.Label.RentalApplyFaultReplyTo_MA) && System.Label.RentalApplyFaultReplyTo_MA != 'null') {
                ccAddr.addAll(System.Label.RentalApplyFaultReplyTo_MA.split(';'));
            }
        } else if (rafObj.Salesdept__c == 'Solution本部') {
            if (rafObj.BuchangApprovalManagerSales__c != null) {
                ccAddr.add(rafObj.BuchangApprovalManagerSales__r.Email);
            }
            if (rafObj.SalesManager__c != null) {
                ccAddr.add(rafObj.SalesManager__r.Email);
            }
            if (!String.isBlank(System.Label.RentalApplyFaultReplyTo_SOLUTION) && System.Label.RentalApplyFaultReplyTo_SOLUTION != 'null') {
                ccAddr.addAll(System.Label.RentalApplyFaultReplyTo_SOLUTION.split(';'));
            }
        } else if (rafObj.Salesdept__c == '医疗服务本部') {
            if (rafObj.BuchangApprovalManagerSales__c != null) {
                ccAddr.add(rafObj.BuchangApprovalManagerSales__r.Email);
            }
            if (rafObj.SalesManager__c != null) {
                ccAddr.add(rafObj.SalesManager__r.Email);
            }
            if (!String.isBlank(System.Label.RentalApplyFaultReplyTo_Yiliao) && System.Label.RentalApplyFaultReplyTo_Yiliao != 'null') {
                ccAddr.addAll(System.Label.RentalApplyFaultReplyTo_Yiliao.split(';'));
            }
        } else if (rafObj.Salesdept__c == '外科事业本部') {
            if (rafObj.BuchangApprovalManagerSales__c != null) {
                ccAddr.add(rafObj.BuchangApprovalManagerSales__r.Email);
            }
            if (rafObj.SalesManager__c != null) {
                ccAddr.add(rafObj.SalesManager__r.Email);
            }
            if (!String.isBlank(System.Label.RentalApplyFaultReplyTo_Waike) && System.Label.RentalApplyFaultReplyTo_Waike != 'null') {
                ccAddr.addAll(System.Label.RentalApplyFaultReplyTo_Waike.split(';'));
            }
        } else if (rafObj.Salesdept__c == '市场企划本部') {
            if (rafObj.BuchangApprovalManagerSales__c != null) {
                ccAddr.add(rafObj.BuchangApprovalManagerSales__r.Email);
            }
            if (rafObj.SalesManager__c != null) {
                ccAddr.add(rafObj.SalesManager__r.Email);
            }
            if (!String.isBlank(System.Label.RentalApplyFaultReplyTo_Shichang) && System.Label.RentalApplyFaultReplyTo_Shichang != 'null') {
                ccAddr.addAll(System.Label.RentalApplyFaultReplyTo_Shichang.split(';'));
            }
        } else if (rafObj.Salesdept__c == '消化·呼吸内镜事业本部') {
            if (rafObj.BuchangApprovalManagerSales__c != null) {
                ccAddr.add(rafObj.BuchangApprovalManagerSales__r.Email);
            }
            if (rafObj.SalesManager__c != null) {
                ccAddr.add(rafObj.SalesManager__r.Email);
            }
            if (!String.isBlank(System.Label.RentalApplyFaultReplyTo_HXNJ) && System.Label.RentalApplyFaultReplyTo_HXNJ != 'null') {
                ccAddr.addAll(System.Label.RentalApplyFaultReplyTo_HXNJ.split(';'));
            }
        } else if (rafObj.Salesdept__c == '消化·呼吸领域解决方案本部') {
            if (rafObj.BuchangApprovalManagerSales__c != null) {
                ccAddr.add(rafObj.BuchangApprovalManagerSales__r.Email);
            }
            if (rafObj.SalesManager__c != null) {
                ccAddr.add(rafObj.SalesManager__r.Email);
            }
            if (!String.isBlank(System.Label.RentalApplyFaultReplyTo_HXLY) && System.Label.RentalApplyFaultReplyTo_HXLY != 'null') {
                ccAddr.addAll(System.Label.RentalApplyFaultReplyTo_HXLY.split(';'));
            }
        }
    }
}
force-app/main/default/classes/RentalApplyFaultHandler.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>50.0</apiVersion>
    <status>Active</status>
</ApexClass>
force-app/main/default/classes/ReportController.cls
@@ -17,7 +17,7 @@
            res.recordTypeId1 = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_SIS_ENG).getRecordTypeId();
            res.recordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_SIS_ET).getRecordTypeId();
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }
@@ -36,7 +36,7 @@
            res.opdPlan = rent.OPDPlan__c;
            res.recordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_OPD).getRecordTypeId();
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }
@@ -257,7 +257,7 @@
        try {
           res =  new InitData();
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }
@@ -276,7 +276,7 @@
            res.datec = re.Date__c;
            res.practitioner1 = re.Practitioner1__c;
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }
@@ -293,18 +293,19 @@
            update rac;
            return null;
        } catch (Exception e) {
            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();
            }
            // 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();
            // }
            return errorMessage(e);
        }
    }
    //OPDtoSIS操作更新相应数据
@@ -317,18 +318,19 @@
            update rac;
            return null;
        } catch (Exception e) {
            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();
            }
            // 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();
            // }
            return errorMessage(e);
        }
    }
@@ -344,18 +346,19 @@
            update rac;
            return null;
        } catch (Exception e) {
            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();
            }
            // 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();
            // }
            return errorMessage(e);
        }
    }
    //完毕操作更新相应数据
@@ -369,18 +372,19 @@
            update rac;
            return null;
        } catch (Exception e) {
            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();
            }
            // 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();
            // }
            return errorMessage(e);
        }
    }
    //OCSM要报告操作更新相应数据
@@ -393,18 +397,19 @@
            update rac;
            return null;
        } catch (Exception e) {
            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();
            }
            // 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();
            // }
            return errorMessage(e);
        }
    }
@@ -418,18 +423,19 @@
            update rac;
            return null;
        } catch (Exception e) {
            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();
            }
            // 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();
            // }
            return errorMessage(e);
        }
    }
    //DispatchOCSMQARA操作更新相应数据
@@ -442,18 +448,19 @@
            update rac;
            return null;
        } catch (Exception e) {
            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();
            }
            // 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();
            // }
            return errorMessage(e);
        }
    }
    //OCSM不要报告操作更新相应数据
@@ -466,18 +473,19 @@
            update rac;
            return null;
        } catch (Exception e) {
            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();
            }
            // 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();
            // }
            return errorMessage(e);
        }
    }
@@ -491,18 +499,19 @@
            update rac;
            return null;
        } catch (Exception e) {
            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();
            }
            // 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();
            // }
            return errorMessage(e);
        }
    }
    
@@ -536,18 +545,19 @@
            update rac;
            return null;
        } catch (Exception e) {
            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();
            }
            // 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();
            // }
            return errorMessage(e);
        }
    }
@@ -561,18 +571,19 @@
            update rac;
            return null;
        } catch (Exception e) {
            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();
            }
            // 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();
            // }
            return errorMessage(e);
        }
    }
@@ -589,18 +600,19 @@
            update rac;
            return null;
        } catch (Exception e) {
            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();
            }
            // 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();
            // }
            return errorMessage(e);
        }
    }
    //VOC回答更新相应数据
@@ -649,18 +661,19 @@
            update rac;
            return null;
        } catch (Exception e) {
            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();
            }
            // 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();
            // }
            return errorMessage(e);
        }
    }
    //VOC判定更新相应数据
@@ -723,18 +736,19 @@
            update report;
            return null;
        } catch (Exception e) {
            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();
            }
            return errorMessage(e);
            // 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();
            // }
        }
    }
    @AuraEnabled
@@ -743,7 +757,7 @@
        try {
            user = [select Id from User where Name =:name]; 
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return user.Id;
    }
@@ -753,10 +767,25 @@
        try {
            profile = [select Id from Profile where Name =:name];
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return profile.Id;
    }
    public static string errorMessage(Exception e){
        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();
        }
    }
    public class InitData{
        @AuraEnabled
        public String status;
force-app/main/default/classes/ReportControllerTest.cls
@@ -1,48 +1,85 @@
@isTest
private  class ReportControllerTest {
    @TestSetup
    static void setData(){
        List<String> strList= new List<String>();
        strList.add('Agency_Contact__c');
        strList.add('Contact');
        TestDataUtility.CreatePIPolicyConfigurations(strList);
        Consum_Apply__c ca = new Consum_Apply__c();
        ca.DataMigration_Flag__c = true;
        insert ca;
        Address_Level__c al = new Address_Level__c();
        al.Name = '東京';
        al.Level1_Code__c = 'CN-99';
        al.Level1_Sys_No__c = '999999';
        insert al;
        // 市
        Address_Level2__c al2 = new Address_Level2__c();
        al2.Level1_Code__c = 'CN-99';
        al2.Level1_Sys_No__c = '999999';
        al2.Level1_Name__c = '東京';
        al2.Name = '渋谷区';
        al2.Level2_Code__c = 'CN-9999';
        al2.Level2_Sys_No__c = '9999999';
        al2.Address_Level__c = al.id;
        insert al2;
    static void makeData(){
        Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin];
        // ユーザー作成
        User hpOwner = new User(Dept__c='医疗华北营业本部',Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
        insert hpOwner;
        // 取引先作成
        List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院'];
        if (rectHp.size() == 0) {
            return;
        }
        List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name = '診療科 消化科'];
        if (rectDpt.size() == 0) {
            return;
        }
        List<RecordType> rectOPD = [select Id,name from RecordType where IsActive = true and SobjectType = 'Report__c' and Name = 'VOC'];
        if (rectOPD.size() == 0) {
            return;
        }
        Account hp1 = new Account(RecordTypeId = rectHp[0].Id, Name = 'TestHp1', OwnerId = hpOwner.Id);
        insert hp1;
        List<Account> dc1 = [Select Id, Name, Department_Class_Label__c from Account where Parent.Id = :hp1.Id and Department_Class_Label__c = '消化科'];
        Account depart1 = new Account();
        depart1.RecordTypeId = rectDpt[0].Id;
        depart1.Name         = '*';
        depart1.Department_Name__c  = '診療科1';
        depart1.ParentId            = dc1[0].Id;
        depart1.Department_Class__c = dc1[0].Id;
        depart1.Hospital__c         = hp1.Id;
        insert depart1;
        //AccountShare dcTS1 = new AccountShare(UserOrGroupId=hpOwner.Id,  AccountId=hp1.Id,AccountAccessLevel='Read', OpportunityAccessLevel = 'Read');
        //insert dcTS1;
        Daily_Report__c dr1 = new Daily_Report__c();
        dr1.Reporter__c = UserInfo.getUserId();
        dr1.Reported_Date__c = date.today();
        dr1.Status__c = '申請中';
        insert dr1;
        Report__c rep1 = new Report__c();
        rep1.CurrencyIsoCode         = 'CNY';
        rep1.RecordTypeId            = rectOPD[0].Id;
        rep1.Status__c               = '';
        rep1.Daily_Report__c         = dr1.Id;
        rep1.Purpose1__c             = 'OPD';
        rep1.Purpose2__c             = '引合追及活動';
        rep1.Reason__c               = '実施背景';
        rep1.Appeal_Point__c         = '実施目的・訴求点';
        rep1.Strategic_Department_Class__c = '1.消化科';
        rep1.Technical_Category1__c  = '消化道检查';
        rep1.Technical_Category2__c  = '普通胃镜检查';
        rep1.Patient_Status__c       = '患者状況';
        rep1.Operation_Process__c    = '手術プロセス';
        rep1.Operation_Task__c       = '手術上の課題';
        rep1.Product_Evaluation_Advantage__c = '製品評価利点';
        rep1.Product_Evaluation_Faults__c = '製品評価欠点';
        rep1.OPD_Summarize__c        = 'OPD実施総括';
        rep1.Activity_Plan__c        = '今後の活動計画';
        rep1.Opportunity_Situation__c = '引合無';
        rep1.OPD_ProductCategory1__c ='3D System';
        rep1.OPD_ProductCategory2__c ='OR Imaging Products';
        rep1.Hospital_Reference__c   = hp1.Id;
        rep1.Department_Class_Ref__c = dc1[0].Id;
        rep1.Hospital_Department__c  = depart1.Id;
        rep1.Status__c = '草案中';
        rep1.Date__c                 = Date.today().addDays(-1);
        insert rep1;
        // 病院を作る
        Account hospital = new Account();
        hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id;
        hospital.Name = 'test hospital';
        hospital.Is_Active__c = '有効';
        hospital.Attribute_Type__c = '卫生部';
        hospital.Speciality_Type__c = '综合医院';
        hospital.Grade__c = '一级';
        hospital.OCM_Category__c = 'SLTV';
        hospital.Is_Medical__c = '医疗机构';
        hospital.State_Master__c = al.id;
        hospital.City_Master__c = al2.id;
        hospital.Town__c = '东京';
        insert hospital;
        // 戦略科室を得る
        Account[] strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_OTH'];
        // 診療科を作る
            // 診療科を作る
        Account dep = new Account();
        dep.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_OTH'].id;
        dep.Name = 'test dep';
@@ -51,98 +88,101 @@
        dep.Department_Class__c = strategicDep[0].Id;
        dep.Hospital__c = hospital.Id;
        insert dep;
        Contact contact2 = new Contact();
        contact2.AccountId = dep.Id;
        contact2.FirstName = '責任者';
        contact2.LastName = 'test1经销商';
        insert contact2;
        // 产品
        Product2 pro5 = new Product2(Name='name05',IsActive=true,Family='SP',
                Fixture_Model_No__c='n05',Serial_Lot_No__c='S/N tracing',
                Fixture_Model_No_T__c = 'n05',
                ProductCode_Ext__c='pc05',Manual_Entry__c=false);
        insert pro5;
        //备品借出申请
        Rental_Apply__c raObj = new Rental_Apply__c();
        raObj.Name = 'testra';
        raObj.Product_category__c = 'GI';
        raObj.Demo_purpose1__c = '产品试用';
        raObj.demo_purpose2__c = FixtureUtil.raDemo_purpose2MAP.get('shiyongwuxunjia');
        raObj.direct_send__c = '医疗机构';
        raObj.Loaner_received_staff__c = '王五';
        raObj.Loaner_received_staff_phone__c = '110';
        raObj.direct_shippment_address__c = '北京市';
        raObj.Hospital__c = hospital.Id;
        raObj.Strategic_dept__c = strategicDep[0].Id;
        raObj.Account__c = dep.Id;
        raObj.Request_shipping_day__c = Date.toDay();  // 希望到货日
        raObj.Hope_Lonaer_date_Num__c = 1;  // 希望借用天数
        // 预定归还日自动生成 预定归还日=(希望到货日+希望借用天数)-1
        // raObj.Request_return_day__c = Date.toDay();  // 预定归还日
        // B.OLY_OCM-669 入力规则: 希望借用天数不能为空
        raObj.Phone_number__c = '1234567890';
        raObj.Loaner_medical_Staff__c = contact2.Id;
        insert raObj;
        Report__c rep = new Report__c();
        rep.VOC_Informer_Contact__c = '139';
        rep.Comment__c = '测试';
        rep.Manual_Name__c = '测试医院/科室/经销商';
        insert rep;
        Consum_Apply__c ca = new Consum_Apply__c();
        ca.DataMigration_Flag__c = true;
        insert ca;
        Rental_Apply__c ra = new Rental_Apply__c();
        ra.Rental_Start_Date__c = Date.today().addDays(1);
        ra.Request_return_day__c=Date.today().addDays(5);
        ra.DataMigration_Flag__c = true;
        //ra.demo_purpose2__c = '其他';
        //ra.Person_In_Charge__c = hpOwner.Id;
        //System.runAs(hpOwner) {
            insert ra;
    }
    static testMethod void methodName1(){
        Report__c rep = [select Id from Report__c limit 1];
        Rental_Apply__c re = [select Id from Rental_Apply__c limit 1];
    static testMethod void test1() {
        Report__c rep1 = [select Id,createdById from Report__c limit 1];
        Consum_Apply__c ca = [select Id from Consum_Apply__c limit 1];
        Test.startTest();
        ReportController.initForASACEditorButton(rep.Id);
        ReportController.initForASRCEditorButton(rep.Id);
        ReportController.initForCancelButton(rep.Id);
        ReportController.initForCompleteButton(rep.Id);
        ReportController.initForNewOnLineSurveyButton(rep.Id);
        ReportController.initForOCSMNoToReportButton(rep.Id);
        ReportController.initForOCSMToReportButton(rep.Id);
        ReportController.initForOPDReportButton(re.Id);
        Rental_Apply__c ra = [select Id from Rental_Apply__c limit 1];
        Id reportId = rep1.Id;
        String createdById = rep1.createdById;
        System.Test.startTest();
        ReportController.initForOPDReportConsumButton(ca.Id);
        ReportController.initForOPDtoSISButton(rep.Id);
        ReportController.initForSIStoOPDButton(rep.Id);
        ReportController.initForSubmitCompetitorReportButton(rep.Id);
        ReportController.initForVOCAnswerButton(rep.Id);
        ReportController.initForVOCCheckButton(rep.Id);
        ReportController.initForVOCConfirmButton(rep.Id);
        ReportController.initForVOCFinishButton(rep.Id);
        ReportController.initForVOCSubmitButton(rep.Id);
        ReportController.updateForCancelButton(rep.Id);
        ReportController.updateForCancelButton('');
        ReportController.updateForCancelSubmitReportButton(rep.Id);
        ReportController.updateForCancelSubmitReportButton('');
        ReportController.updateForCompleteButton(rep.Id);
        ReportController.updateForCompleteButton('');
        ReportController.updateForDispatchOCSMQARAButton(rep.Id);
        ReportController.updateForDispatchOCSMQARAButton('');
        ReportController.updateForOCSMNoToReportButton(rep.Id);
        ReportController.updateForOCSMNoToReportButton('');
        ReportController.updateForOCSMToReportButton(rep.Id);
        ReportController.updateForOCSMToReportButton('');
        ReportController.updateForOPDtoSISButton(rep.Id);
        ReportController.updateForOPDtoSISButton('');
        ReportController.updateForSIStoOPDButton(rep.Id);
        ReportController.updateForSIStoOPDButton('');
        ReportController.updateForSubmitButton(rep.Id);
        ReportController.updateForSubmitButton('');
        ReportController.updateForSubmitCompetitorReportButton(rep.Id);
        ReportController.updateForSubmitCompetitorReportButton('');
        ReportController.updateForVOCAnswerButton(rep.Id);
        ReportController.updateForVOCAnswerButton('');
        ReportController.updateForVOCCheckButton(rep.Id,'VOC',UserInfo.getUserId());
        ReportController.updateForVOCConfirmButton(rep.Id,'否', '是');
        ReportController.updateForVOCFinishButton(rep.Id);
        ReportController.updateForVOCFinishButton('');
        ReportController.updateForVOCSubmitButton(rep.Id, UserInfo.getUserId());
        Test.stopTest();
        ReportController.initForOPDReportButton(ra.Id);
        ReportController.initForVOCFinishButton(reportId);
        ReportController.initForVOCCheckButton(reportId);
        ReportController.initForVOCSubmitButton(reportId);
        ReportController.initForVOCAnswerButton(reportId);
        ReportController.initForVOCConfirmButton(reportId);
        ReportController.initForCancelButton(reportId);
        ReportController.initForOCSMNoToReportButton(reportId);
        ReportController.initForSIStoOPDButton(reportId);
        ReportController.initForOCSMToReportButton(reportId);
        ReportController.initForCompleteButton(reportId);
        ReportController.initForASRCEditorButton(reportId);
        ReportController.initForASACEditorButton(reportId);
        ReportController.initForOPDtoSISButton(reportId);
        ReportController.initForSubmitCompetitorReportButton(reportId);
        ReportController.initForNewOnLineSurveyButton(reportId);
        ReportController.updateForSubmitButton(reportId);
        ReportController.updateForOPDtoSISButton(reportId);
        ReportController.updateForCancelSubmitReportButton(reportId);
        ReportController.updateForCompleteButton(reportId);
        ReportController.updateForOCSMToReportButton(reportId);
        ReportController.updateForSIStoOPDButton(reportId);
        ReportController.updateForDispatchOCSMQARAButton(reportId);
        ReportController.updateForOCSMNoToReportButton(reportId);
        ReportController.updateForCancelButton(reportId);
        ReportController.updateForVOCConfirmButton(reportId,'否','是');
        ReportController.updateForVOCAnswerButton(reportId);
        ReportController.updateForSubmitCompetitorReportButton(reportId);
        ReportController.updateForVOCSubmitButton(reportId,createdById);
        ReportController.updateForVOCCheckButton(reportId,'VOC',UserInfo.getUserId());
        ReportController.updateForVOCFinishButton(reportId);
        System.Test.stopTest();
    }
    static testMethod void test2() {
        System.Test.startTest();
        ReportController.initForOPDReportConsumButton('');
        ReportController.initForOPDReportButton('');
        ReportController.initForVOCFinishButton('');
        ReportController.initForVOCCheckButton('');
        ReportController.initForVOCSubmitButton('');
        ReportController.initForVOCAnswerButton('');
        ReportController.initForVOCConfirmButton('');
        ReportController.initForCancelButton('');
        ReportController.initForOCSMNoToReportButton('');
        ReportController.initForSIStoOPDButton('');
        ReportController.initForOCSMToReportButton('');
        ReportController.initForCompleteButton('');
        ReportController.initForASRCEditorButton('');
        ReportController.initForASACEditorButton('');
        ReportController.initForOPDtoSISButton('');
        ReportController.initForSubmitCompetitorReportButton('');
        ReportController.initForNewOnLineSurveyButton('');
        ReportController.updateForSubmitButton('');
        ReportController.updateForOPDtoSISButton('');
        ReportController.updateForCancelSubmitReportButton('');
        ReportController.updateForCompleteButton('');
        ReportController.updateForOCSMToReportButton('');
        ReportController.updateForSIStoOPDButton('');
        ReportController.updateForDispatchOCSMQARAButton('');
        ReportController.updateForOCSMNoToReportButton('');
        ReportController.updateForCancelButton('');
        ReportController.updateForVOCConfirmButton('','否','是');
        ReportController.updateForVOCAnswerButton('');
        ReportController.updateForSubmitCompetitorReportButton('');
        ReportController.updateForVOCSubmitButton('','');
        ReportController.updateForVOCCheckButton('','VOC',UserInfo.getUserId());
        ReportController.updateForVOCFinishButton('');
        System.Test.stopTest();
    }
    
}
force-app/main/default/classes/StaticParameter.cls
@@ -20,6 +20,14 @@
    //跳过订单的查询 
    public static Boolean ConsumableOrderTrigger = false;
    //SummaryContractFMBatch
    public static Boolean MaintenanceContractAssetTrigger = true;
    public static Boolean SetContractEstimatePriceTrigger = true;
    public static Boolean MaintenanceContractTrigger = true;
    public static Boolean MaintenanceContractHpDeptUpdTrigger = true;
    public static Boolean EscapeConsumableOrderDetail2Trigger = false;
    public static Boolean EscapeOrderDetail2Trigger = false;
@@ -30,7 +38,10 @@
    // 跳过不涉及备品借出的逻辑
    public static Boolean rentalApplyIsRunning = false;
    // accountdailyUpdate 跳过 更新询价
    // TenderInformationTrigger 跳过 更新询价
    public static Boolean EscapeTenderInformationUpdate  = true;
    // accountdailyUpdate 跳过 更新招标项目
    public static Boolean EscapeOpportunityownerUpdate  = false;
    
    // 跳过修理AE更新
@@ -66,8 +77,36 @@
    // 预测跳过询价和注残
    public static Boolean EscapeOppandStaTrigger = false;
    //跳过文档链接接口
    // 2023/3/30 正常执行RepairAgainAnTrigger
    public static Boolean RepairAgainAnStaTrigger = true;
    // DB202304087063 SFDC系统附件上传自动通知功能开发需求 start
    // 备注生成附件时,附件不发送邮件
    public static Boolean AttachmentTrigger = true;
    // DB202304087063 SFDC系统附件上传自动通知功能开发需求 end
    public static Boolean EscapeQISTrigger = true;
    // DB202306447415 gzw 接口执行速度优化 start
    public static Boolean EscapeNFM110Trigger = false;
    // DB202306447415 gzw 接口执行速度优化 end
    // DB202307108459 ssm 基建项目trigger跳过标记 start
    public static Boolean EscapeInfrastructureProductTrigger = false;
    // DB202307108459 ssm 基建项目trigger跳过标记 end
    //zc lt 20230918 start DB202308327700 跳过众成数据
    public static Boolean EscapeZCUpdateTender = false;
    //zc lt 20230918 end DB202308327700 跳过众成数据
    //20230918 lt DB202306372336 进招标触发器(询价关联科室改变时) start
    public static Boolean UpdateDandang = false;
    //20230918 lt DB202306372336 进招标触发器 end
    //20230922 cjw 文件相关触发器 start
    public static Boolean ContentDocumentTrigger = true;
    public static Boolean ContentDocumentLink = true;
    public static Boolean ContentVerisonTrigger = true;
    //20230922 cjw 文件相关触发器 start
    public StaticParameter(){
    }
force-app/main/default/classes/StaticParameter.cls-meta.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>29.0</apiVersion>
    <apiVersion>51.0</apiVersion>
    <status>Active</status>
</ApexClass>
force-app/main/default/classes/UpdateContractAimAmountHandler.cls
@@ -284,7 +284,7 @@
                    acc.CustomizePageFlg__c = false;
                }else{
                    System.debug('lt123-----else,acc.CustomizePageFlg__c-----'+acc.CustomizePageFlg__c);
                    acc.addError('请点击链接(相关项)确认具体信息后审批。');
                     acc.addError('请点击进入客户详情页面,在‘批准历史’栏目下进行批准或拒绝操作');
                }
            }
        }
force-app/main/default/classes/lexPCLLostReportLwcController.cls
@@ -31,7 +31,11 @@
    public static integer secondNum {get; set;}
    // add tcm 20211122 end
    @AuraEnabled(cacheable=true)
    public static Id getUserProfileId() {
        Id profileId = [SELECT ProfileId FROM User WHERE Id = :UserInfo.getUserId()].ProfileId;
        return profileId;
    }
    @AuraEnabled
    public static String getPickList(String objectName, String fieldName) {
        List<Map<String, String>> lstPickvals = new List<Map<String, String>>();
@@ -47,6 +51,8 @@
        Map<string,List<Map<String, String>>> pickList =  new Map<string,List<Map<String, String>>>();
        List<Map<String, String>> zhuji = new List<Map<String, String>>();
        List<Map<String, String>> jingzi = new List<Map<String, String>>();
        List<Map<String, String>> xixiaoji = new List<Map<String, String>>();
        List<Map<String, String>> guangyuan = new List<Map<String, String>>();
        List<Map<String, String>> xiaojingzhong = new List<Map<String, String>>();
        List<Map<String, String>> nengliang = new List<Map<String, String>>();
        List<Map<String, String>> qita = new List<Map<String, String>>();
@@ -57,19 +63,25 @@
        nengliang.add(empty);
        qita.add(empty);
        for (Integer i = 0; i < lstPickvals.size(); i++) {
            if ((i >= 0 && i <= 6) || i == 36) {
            if ((i >= 0 && i <= 6) || i == 38) {
                zhuji.add(lstPickvals[i]);
            }
            if ((i >= 7 && i <= 23) || i == 36) {
            if ((i >= 7 && i <= 23) || i == 38) {
                jingzi.add(lstPickvals[i]);
            }
            if ((i >= 24 && i <= 29) || i == 35) {
            if ((i >= 24 && i <= 29) || i == 35|| i == 38) {
                xiaojingzhong.add(lstPickvals[i]);
            }
            if ((i >= 30 && i <= 34) || i == 36) {
            if ((i >= 30 && i <= 34) || i == 38) {
                nengliang.add(lstPickvals[i]);
            }
            if (i == 36) {
                guangyuan.add(lstPickvals[i]);
            }
            if (i == 37) {
                xixiaoji.add(lstPickvals[i]);
            }
            if (i == 38) {
                qita.add(lstPickvals[i]);
            }
        }
@@ -77,6 +89,8 @@
        pickList.put('镜子', jingzi);
        pickList.put('小镜种', xiaojingzhong);
        pickList.put('能量', nengliang);
        pickList.put('洗消机', xixiaoji);
        pickList.put('光源', guangyuan);
        pickList.put('其他', qita);
        return JSON.serialize(pickList);
    }
@@ -156,7 +170,7 @@
             Manager_sales__c,recordtypeid,recordtype.DeveloperName
             from Lost_cancel_report__c
             where id =: lostReportId limit 1];
            System.debug('chenjingwu' + lostReportList);
            if(lostReportList.size() == 0) {
                pageStatus = null;
                maps.put('message', '您没有查看这个失单/部分失单报告的权限!');
@@ -193,11 +207,12 @@
            [
                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,
                Lost_cancel_report__c,Lost_By_Company_Mannual__c,ChannelSpecificReasons__c,
                ( select id,PCLLostBrand__c,LostProduct__c,
                LostProduct__r.Name,
                  LostProductMannual__c,            //SWAG-C6P9PX lt 20210913 add
                  ProductCategory__c,ProductClass__c, //add tcm 20211123
                  ProductCategory__c,
                  ProductClass__c, //add tcm 20211123
                  Quantity__c,Name, LostBrandName__c 
                  from PCLLostBrand__c.PCLLostBrandProduct__r)
                from PCLLostBrand__c
@@ -216,8 +231,11 @@
                    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));
                            PCLLostProducts pro = new PCLLostProducts(productCount,tempProduct);
                            if(tempProduct.LostProduct__r.Name != null){
                                pro.productName = tempProduct.LostProduct__r.Name;
                            }
                            tempProductList.add(pro);
                            productCount++;
                        }
                    } else {
@@ -230,10 +248,15 @@
                                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));
                    LostBrand br = new LostBrand(brandCount,tempProductList, templostBrand);
                    if(tempLostBrand.ChannelSpecificReasons__c != null){
                        br.reasonFlag = true;
                    }
                    LostBrandList.add(br);
                    brandCount++;
                }
@@ -245,8 +268,29 @@
        // 读取竞争对手品牌
        // BrandmapSet();
        
        if (LostReport.lostReport.Report_Status__c != '草案' && lostReportId != null) {
            ProcessInstance pro = [
        if (lostReportId != null) {
            // List<ProcessInstance> pros = [
            // SELECT
            // ProcessDefinition.Name,
            //     (
            //     SELECT
            //     Id,
            //     StepStatus,
            //     IsPending,
            //     Comments,
            //     CreatedDate,
            //     Actor.Name,
            //     OriginalActor.Name,
            //     ProcessNode.Name FROM StepsAndWorkitems order by IsPending DESC, CreatedDate DESC
            // )
            // FROM ProcessInstance where TargetObjectId =:LostReport.lostReport.id order by CreatedDate DESC
            // ];
            // List<ProcessInstanceHistory> items = new List<ProcessInstanceHistory>();
            // for(ProcessInstance pro: pros){
            //     items.add(pro.StepsAndWorkitems);
            // }
            // LostReport.approvalHistorys = items;
            List<ProcessInstance> pros = [
            SELECT 
            ProcessDefinition.Name,
                (
@@ -262,8 +306,19 @@
            )
            FROM ProcessInstance where TargetObjectId =:LostReport.lostReport.id order by CreatedDate DESC
            ];
            if(pros.size() > 0){
                List<ProcessInstanceHistory> items = new List<ProcessInstanceHistory>();
                for(ProcessInstance pro: pros){
                    items.addAll(pro.StepsAndWorkitems);
                }
                LostReport.approvalHistorys = items;
            }else{
                List<ProcessInstanceHistory> items = new List<ProcessInstanceHistory>();
                LostReport.approvalHistorys = items;
            }
        }else{
            List<ProcessInstanceHistory> items = new List<ProcessInstanceHistory>();
            items.addall(pro.StepsAndWorkitems);
            LostReport.approvalHistorys = items;
        }
        if(string.isNotEmpty(submitFlag)) {
@@ -309,7 +364,12 @@
                                  from BatchIF_Transfer__c
                                  where Dropped_Flag__c = false
                                          and Table__c = 'PCLLostBrand__c' and Column__c = 'Lost_By_Company__c' and External_value__c =: productName];
            return transfer[0].Internal_value__c;
            if(transfer.size() > 0){
                return transfer[0].Internal_value__c;
            }else{
                return null;
            }
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
@@ -317,6 +377,7 @@
    // 数据录入
    @AuraEnabled
    public static Map<String,String> dataEntry(String report1,List<Id> deleteBrandIdList,List<Id> deleteProductIdList){
        // LostReport report = (LostReport)JSON.deserializeUntyped(report1, LostReport.class);
        LostReport report = (LostReport)JSON.deserialize(report1, LostReport.class);
        Map<String,String> messageMap = new Map <String,String>();
        system.debug('save---start:');
@@ -332,8 +393,8 @@
            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;
            if(report.lostReport.Approved_Day__c != null){
                report.lostReport.ModifyAfterApproval__c = true;
            }
            for(LostBrand tempLostBrand : report.LostBrands) {
                if(string.isNotBlank(tempLostBrand.lostBrand.Lost_By_Company__c)) {
@@ -451,7 +512,7 @@
                }
            }
            if (report.lostReport.Report_Status__c != '草案') {
                ProcessInstance pro = [
                List<ProcessInstance> pros = [
                SELECT 
                ProcessDefinition.Name,
                 (
@@ -468,16 +529,33 @@
                FROM ProcessInstance where TargetObjectId =:reportId order by CreatedDate DESC
                ];
                List<ProcessInstanceHistory> items = new List<ProcessInstanceHistory>();
                items.addall(pro.StepsAndWorkitems);
                for(ProcessInstance pro: pros){
                    items.addAll(pro.StepsAndWorkitems);
                }
                report.approvalHistorys = items;
            }else{
                List<ProcessInstanceHistory> items = new List<ProcessInstanceHistory>();
                report.approvalHistorys = items;
            }
            // lostReportId = report.lostReport.id;
            system.debug('save---end:');
            messageMap.put('LostReport',JSON.serialize(report));
        }catch (Exception ex) {
        }catch (Exception e) {
            Database.rollback(sp);
            // 这里需要写一些报错信息
            messageMap.put('error', ex.getMessage());
            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);
                messageMap.put('error', ''+ newStr);
            }else {
                messageMap.put('error', ''+ e.getMessage());
            }
            return messageMap;
        }
        return messageMap;
@@ -486,19 +564,20 @@
    
    // 提交
    @AuraEnabled
    public static Map<string,Object> submit(String report1,String reportId){
        LostReport report = (LostReport)JSON.deserialize(report1, LostReport.class);
    public static Map<string,Object> submit(String reportStatus,Boolean modifyAfterApproval,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) && LostReport.LostReport.ModifyAfterApproval__c == false) {
        if(!'草案'.equals(reportStatus) && modifyAfterApproval == false) {
            messages.put('error', '只有在草案中才能提交申请!');
            return messages;
        }
        Map<string,Object> objs = new Map<string,Object>();
        Lost_cancel_report__c report = new Lost_cancel_report__c();
        Savepoint sp = Database.setSavepoint();
        try{
            report.lostReport.Id = reportId;
            report.lostReport.Report_Status__c = '提交';
            update report.lostReport;
            report.Id = reportId;
            report.Report_Status__c = '提交';
            update report;
            // Approval.ProcessSubmitRequest psr = new Approval.ProcessSubmitRequest();
            // psr.setObjectId(reportId);
            // Approval.ProcessResult submitResult = Approval.process(psr);
@@ -506,7 +585,7 @@
            objs.put('Id', reportId);
            objs.put('pageStatus', 'View');
            objs.put('submitFlag', '1');
            ProcessInstance pro = [
            List<ProcessInstance> pros = [
                SELECT 
                ProcessDefinition.Name,
                 (
@@ -522,13 +601,28 @@
                )
                FROM ProcessInstance where TargetObjectId =:reportId order by CreatedDate DESC
            ];
            List<ProcessInstanceHistory> items = new List<ProcessInstanceHistory>();
            items.addall(pro.StepsAndWorkitems);
            for(ProcessInstance pro:pros){
                items.addAll(pro.StepsAndWorkitems);
            }
            objs.put('approvalHistorys',items);
            return objs;
        }catch(exception ex) {
        }catch(exception e) {
            Database.rollback(sp);
            messages.put('error', ex.getMessage());
            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);
                objs.put('error', ''+ newStr);
            }else {
                objs.put('error', ''+ e.getMessage());
            }
            return messages;
        }
    }
@@ -591,9 +685,14 @@
        public list<PCLLostProducts> LostProducts;
        @AuraEnabled
        public Integer ProductSize;
        @AuraEnabled
        public Boolean reasonFlag = false;
        @AuraEnabled
        public String brandTitle;
        public LostBrand( integer lineNo ){
            lostBrand = new PCLLostBrand__c();
            this.lineNo = lineNo;
            this.brandTitle = '失单品牌' + (lineNo + 1);
            LostProducts = new list<PCLLostProducts> {new PCLLostProducts()};
            ProductSize = 1;
            lostBrand = new PCLLostBrand__c();
@@ -601,12 +700,14 @@
        public LostBrand( integer lineNo, list<PCLLostProducts> LostProducts ){
            lostBrand = new PCLLostBrand__c();
            this.lineNo = lineNo;
            this.brandTitle = '失单品牌' + (lineNo + 1);
            this.LostProducts = LostProducts;
            ProductSize = LostProducts.size();
        }
        public LostBrand( integer lineNo, list<PCLLostProducts> LostProducts,  PCLLostBrand__c lostBrand){
            this.lostBrand = lostBrand;
            this.lineNo = lineNo;
            this.brandTitle = '失单品牌' + (lineNo + 1);
            this.LostProducts = LostProducts;
            ProductSize = LostProducts.size();
        }
@@ -647,11 +748,12 @@
    public static 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;
        }else {
            Product2 prd = [select Id,ProductClass__c, ProductCategory__c from Product2 where Id =:LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.LostProduct__c];
            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;
@@ -668,7 +770,10 @@
    public static string searchProduct(String lostProduct){
        Product2 prd = null;
        try {
            prd = [select Id,ProductClass__c, ProductCategory__c from Product2 where Id =:lostProduct];
            prd = [select Id
            ,ProductClass__c
            , ProductCategory__c
            from Product2 where Id =:lostProduct];
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
@@ -677,4 +782,38 @@
    // add tcm 20211118 end
    @AuraEnabled
    public static String submitForApproval(String recordId, String comments,String action){
        try {
            List<ProcessInstanceWorkitem> workItems = [
            SELECT Id, ProcessInstanceId
            FROM ProcessInstanceWorkitem
            WHERE ProcessInstance.TargetObjectId = :recordId
            ];
            Approval.ProcessWorkitemRequest req = new Approval.ProcessWorkitemRequest();
            req.setWorkitemId(workItems.get(0).Id);
            req.setAction(action);
            req.setComments(comments);
            Approval.ProcessResult result = Approval.process(req);
            return null;
        } catch (Exception e) {
            return e.getMessage();
        }
    }
    @AuraEnabled
    public static String reassignStep(String recordId, String newActorId ){
        try {
            List<ProcessInstanceWorkItem> workItemList = [SELECT ActorId FROM ProcessInstanceWorkitem WHERE ProcessInstance.TargetObjectId = : recordId];
            ApprovalHistoryUtil.reassignStep(workItemList, newActorId);
            return null;
        } catch (Exception e) {
            return e.getMessage();
        }
    }
}
force-app/main/default/lwc/approvalHistoryLWC/ApprovalHistoryLWC.css
New file
@@ -0,0 +1,7 @@
.slds-icon-standard-approval {
    background-color: #dcd861;
  }
  .lookup-form {
    padding-bottom: 100px;
  }
force-app/main/default/lwc/approvalHistoryLWC/approvalHistoryLWC.html
New file
@@ -0,0 +1,200 @@
<template>
    <div>
      <lightning-card>
        <template  if:true={isLoading}>
              <p>测试</p>
              <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
      </template>
        <h3 slot="title">
          <lightning-icon
            icon-name="standard:approval"
            size="small"
          ></lightning-icon>
          <a
            class="slds-card__header-link slds-p-left_medium"
            if:true={approvalHistory}
            >批准历史 ({approvalHistory.approvalStepsSize})</a
          >
        </h3>
        <div slot="actions" if:true={approvalHistory}>
          <ul class='slds-button-group-list'>
            <li if:true={showSubmitForApprovalButton}>
              <lightning-button
            data-id="SubmitForApproval"
            label="Submit for Approval"
            if:true={showSubmitForApprovalButton}
            onclick={handleSubmitForApprovalClick}
          ></lightning-button>
            </li>
            <li if:true={approvalHistory.isCurrentUserApprover}>
              <lightning-button
            data-id="Approve"
            label="批准"
            if:true={approvalHistory.isCurrentUserApprover}
            onclick={handleApproveClick}
          ></lightning-button>
        </li>
            <li if:true={approvalHistory.isCurrentUserApprover}>
              <lightning-button
            data-id="Reject"
            label="拒绝"
            if:true={approvalHistory.isCurrentUserApprover}
            onclick={handleRejectClick}
          ></lightning-button></li>
            <li ><lightning-button-menu
            menu-alignment='right'
            alternative-text="Show menu"
            if:true={showButtonMenu}
          >
            <lightning-menu-item
              data-id="Reassign"
              value="Reassign"
              label="重新分配"
              if:true={approvalHistory.isCurrentUserApprover}
              onclick={handleReassignClick}
            ></lightning-menu-item>
            <lightning-menu-item
              data-id="Recall"
              value="Recall"
              label="撤回"
              if:true={approvalHistory.showRecall}
              onclick={handleRecallClick}
            ></lightning-menu-item>
          </lightning-button-menu></li>
          </ul>
          <!-- <lightning-button
            data-id="SubmitForApproval"
            label="Submit for Approval"
            if:true={showSubmitForApprovalButton}
            onclick={handleSubmitForApprovalClick}
          ></lightning-button>
          <lightning-button
            data-id="Approve"
            label="批准"
            if:true={approvalHistory.isCurrentUserApprover}
            onclick={handleApproveClick}
          ></lightning-button> -->
<!--           <lightning-button
            data-id="Approve1"
            label="测试"
            if:true={approvalHistory.isCurrentUserApprover}
            onclick={handleApproveClick1}
          ></lightning-button> -->
         <!--  <lightning-button
            data-id="Reject"
            label="拒绝"
            if:true={approvalHistory.isCurrentUserApprover}
            onclick={handleRejectClick}
          ></lightning-button> -->
          <!-- <lightning-button-menu
            alternative-text="Show menu"
            if:true={showButtonMenu}
          >
            <lightning-menu-item
              data-id="Reassign"
              value="Reassign"
              label="重新分配"
              if:true={approvalHistory.isCurrentUserApprover}
              onclick={handleReassignClick}
            ></lightning-menu-item>
            <lightning-menu-item
              data-id="Recall"
              value="Recall"
              label="撤回"
              if:true={approvalHistory.showRecall}
              onclick={handleRecallClick}
            ></lightning-menu-item>
          </lightning-button-menu> -->
        </div>
        <template if:true={showDataTable}>
          <lightning-datatable
            key-field="id"
            data={approvalHistory.approvalSteps}
            columns={columns}
            hide-checkbox-column
            class="myApprovalHistoryTable"
          ></lightning-datatable>
        </template>
        <template if:true={showDataTable}>
          <!-- needed to use the footer class because the tob bar looked weird with the datatable component on top-->
          <center>
           <!--  <p  class="slds-p-around_large">
              <lightning-formatted-url
                value={viewAllUrl}
                label="查看全部"
              ></lightning-formatted-url>
            </p>   -->
          </center>
        </template>
        <c-modal data-id="submitForApproval" onclosedialog={handleModalCancel} obj-name={objectApiName}>
          <div slot="header">{modalTitle}</div>
          <div class="slds-form-element" if:true={showCommentModal} style="height:460px !important">
            <template lwc:if={isShow} >
              <template lwc:if={isAcc}>
                <lightning-record-edit-form object-api-name="Account" record-id={recordId}>
                  <lightning-input-field  style={inputFieldStyle} disabled={RejectionReasonDis} field-name="RejectionReason__c" value={obj.RejectionReason__c} onchange={fieldChange}></lightning-input-field>
                  <lightning-input-field style={inputFieldStyle} disabled={AssociatedHospitalDis} field-name="AssociatedHospital__c" value={obj.AssociatedHospital__c} onchange={fieldChange}></lightning-input-field>
                  <lightning-input-field  style={inputFieldStyleTwo} disabled={InstitutionalTypeDis} field-name="InstitutionalType__c" value={obj.InstitutionalType__c} onchange={fieldChange}></lightning-input-field>
                  <lightning-input-field  style={inputFieldStyleTwo} disabled={HospitalTypeDis} field-name="HospitalType__c" value={obj.HospitalType__c} onchange={fieldChange}></lightning-input-field>
                  <lightning-input-field style={inputFieldStyleTwo} disabled={WhetherRiskPassingDis} field-name="WhetherRiskPassing__c" value={obj.WhetherRiskPassing__c} onchange={fieldChange}></lightning-input-field>
                </lightning-record-edit-form>
              </template>
              <template lwc:elseif={isAccApply}>
                <lightning-record-edit-form object-api-name="Account_Delay_Apply__c">
                  <lightning-input-field style={inputFieldStyleThree} disabled={InstitutionalTypeDis}  field-name="InstitutionalType__c" value={obj.InstitutionalType__c} onchange={fieldChange}></lightning-input-field>
                  <lightning-input-field style={inputFieldStyleFour} disabled={HospitalTypeDis} field-name="HospitalType__c" value={obj.HospitalType__c} onchange={fieldChange}></lightning-input-field>
                  <lightning-input-field style={inputFieldStyleFour} disabled={WhetherRiskPassingDis} field-name="WhetherRiskPassing__c" value={obj.WhetherRiskPassing__c} onchange={fieldChange}></lightning-input-field>
                </lightning-record-edit-form>
              </template>
              <template lwc:elseif={isSolution}>
                <lightning-record-edit-form object-api-name="Solution_Programme__c">
                  <lightning-input-field required="true" field-name="Confirmation_Result__c" value={obj.Confirmation_Result__c} onchange={fieldChange}></lightning-input-field>
                  <lightning-input-field field-name="Remarks__c" value={obj.Remarks__c} onchange={fieldChange}></lightning-input-field>
                </lightning-record-edit-form>
              </template>
            </template>
            <!-- <lightning-input data-id="comment" type="text" label="客户民" value={obj.Name}></lightning-input> -->
            <lightning-input data-id="comment" type="text" label="评论" value=""></lightning-input>
          </div>
          <div class="slds-form-element lookup-form" if:true={showLookupModal}>
            <c-approval-look-up
              errors={lookupErrors}
              onsearch={handleLookupSearch}
              onselectionchange={handleSelectionChange}
              label={lookupLabel}
              placeholder="Search Users..."
              is-multi-entry={isMultiEntry}
              required
            >
            </c-approval-look-up>
          </div>
          <div slot="footer">
            <lightning-button
              data-id="Cancel"
              label="取消"
              onclick={handleModalCancel}
            ></lightning-button>
            <lightning-button
              data-id="Submit"
              label={modalsubmitLabel}
              variant="brand"
              class="slds-p-left_small"
              onclick={handleModalSubmit}
            ></lightning-button>
          </div>
        </c-modal>
      </lightning-card>
    </div>
  </template>
force-app/main/default/lwc/approvalHistoryLWC/approvalHistoryLWC.js
New file
@@ -0,0 +1,859 @@
import { LightningElement, api, track, wire } from "lwc";
import getApprovalHistory from "@salesforce/apex/ApprovalHistoryController.getApprovalHistory";
import submitForApprovalApex from "@salesforce/apex/ApprovalHistoryController.submitForApproval";
import reassignStep from "@salesforce/apex/ApprovalHistoryController.reassignStep";
import processStep from "@salesforce/apex/ApprovalHistoryController.processStep";
import searchUsers from "@salesforce/apex/ApprovalHistoryController.searchUsers";
import saveRecord from "@salesforce/apex/ApprovalHistoryController.saveRecord";
import { CloseActionScreenEvent } from 'lightning/actions';
import getInitData from "@salesforce/apex/ApprovalHistoryController.getInitData";
import { getRecord } from 'lightning/uiRecordApi';
import ProfileId_SystemAdmin from '@salesforce/label/c.ProfileId_SystemAdmin';
import ProfileId_2J3 from '@salesforce/label/c.ProfileId_2J3';
import USER_ID from '@salesforce/user/Id';
import {
  verifyIfNextApproverWasNeeded,
  hideModal,
  showModal,
  getCommentPropertyFromModal,
  showGetNextApproverModal,
  validateUserLookup,
  setSelectedUser,
  clearModalState,
  displayToast,
  extractErrorMessage,
  modalStates,
  displayToastErrorQuery
} from "./approvalHistoryUtil.js";
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import { refreshApex } from "@salesforce/apex";
const ERROR = "error";
const SUCCESS = "success";
const FIELDS = ['ObjectName__c.Id', 'ObjectName__c.Name'];
const columns = [
  {
    label: "步骤名称",
    fieldName: "stepName",
    type: "text",
    typeAttributes: {
      label: {
        fieldName: "stepName"
      }
    }
  },
  {
    label: "日期",
    fieldName: "createdDate",
    type: "date",
    typeAttributes: {
      month: "numeric",
      day: "numeric",
      year: "numeric",
      hour: "numeric",
      minute: "numeric"
    }
  },
  { label: "状态", fieldName: "stepStatus" },
  {
    label: "被分配人",
    fieldName: "OriginalToUrl",
    type: "url",
    typeAttributes: {
      label: {
        fieldName: "OriginalTo"
      }
    }
  },
  {
    label: "实际批准人",
    fieldName: "assignedToUrl",
    type: "url",
    typeAttributes: {
      label: {
        fieldName: "assignedTo"
      }
    }
  },
  { label: "评论", fieldName: "comments" },
];
export default class ApprovalHistory extends LightningElement {
  @api recordId;
  @track isLoading=false;
  @api objectApiName;
  @api showComments; //Determines if the component will show the comments column
  @api allowSubmitForApproval; //determines if the component will allow Submit for Approval functionality
  @track approvalHistory; //approval history to display on page
  @track isShow;//是否展示需要填写的表单
  wiredApprovalHistory; //property used to refreshApex
  //modal properties
  currentModalState; //decides which type of modal to display depending on the action happening(approve, reject, recall, etc)
  modalComment; //temporarily stores the value of the comment input field in the modal
  selectedUser; //temporarily stores the selected user from the lookup component in the modal
  //end modal properties
  //lookup properties
  lookupErrors = []; //errors related to the lookup component
  isMultiEntry = false;
  initialSelection = [];
  @track obj = {};
  fieldChange(event){
    const { value } = event.detail;
    const { fieldName } = event.target || event.currentTarget;
    let checked = event.target.value||event.currentTarget.value;
    if (value == undefined && checked != undefined) {
        this.obj = {
            ...this.obj,
            [fieldName]: checked
        };
    } else {
        let theValue = value instanceof Array ? value[0] : value;
        if(theValue===undefined){
            theValue = '';
        }
        this.obj = {
            ...this.obj,
            [fieldName]: theValue
        };
    }
    if(this.objectApiName==='Account'&&fieldName=='RejectionReason__c'){
      if(this.obj.RejectionReason__c==='重复'){
        this.AssociatedHospitalDis = false;
      }else{
        this.AssociatedHospitalDis = true;
      }
      if (this.isdealers) {
        this.RejectionReasonDis = true;
        this.AssociatedHospitalDis = true;
        this.InstitutionalTypeDis = true;
        this.HospitalTypeDis = true;
        this.WhetherRiskPassingDis = false;
      }else{
        this.WhetherRiskPassingDis = true;
      }
    }
    if(this.objectApiName==='Account'&&fieldName=='InstitutionalType__c'){
      if(this.obj.InstitutionalType__c==='非医疗机构'){
        this.HospitalTypeDis = false;
      }else{
        this.HospitalTypeDis = true;
      }
      if (this.isdealers) {
        this.RejectionReasonDis = true;
        this.AssociatedHospitalDis = true;
        this.InstitutionalTypeDis = true;
        this.HospitalTypeDis = true;
        this.WhetherRiskPassingDis = false;
      }else{
        this.WhetherRiskPassingDis = true;
      }
    }
    if(this.objectApiName==='Account_Delay_Apply__c'&&fieldName=='InstitutionalType__c'){
      if(this.obj.InstitutionalType__c==='非医疗机构'){
        this.HospitalTypeDis = false;
      }else{
        this.HospitalTypeDis = true;
      }
      if (this.isdealers) {
        this.WhetherRiskPassingDis = false;
      }else{
        this.WhetherRiskPassingDis = true;
      }
    }
  }
  //end lookup properties
  get columns() {
    let tempColumns = columns;
    if(this.showComments){
      tempColumns.push({
        label: "Comments", fieldName: "comments"
      });
    }
    return tempColumns;
  }
  //url that will display all of the approval process history
  get viewAllUrl() {
    return "/lightning/r/" + this.recordId + "/related/ProcessSteps/view";
  }
  @track isAcc;
  @track isAccApply;
  @track isSolution=false;
  @track isadmin=false;
  @track isdealers;
  @track RejectionReasonDis = true;
  @track AssociatedHospitalDis = true;
  @track inputFieldStyle = 'display: block;';
  @track inputFieldStyleTwo = 'display: block;';
  @track inputFieldStyleThree = 'display: block;';
  @track inputFieldStyleFour = 'display: block;';
  @track InstitutionalTypeDis = true;
  @track HospitalTypeDis = true;
  @track WhetherRiskPassingDis = true;
  nodeName;
  connectedCallback(){
    console.log('connectedCallback');
    console.log(this.objectApiName);
    console.log(this.recordId);
    if(this.objectApiName==='Account'){
      //客户
      this.isAcc = true;
      this.isAccApply = false;
      this.isSolution = false;
    }else if(this.objectApiName==='Account_Delay_Apply__c'){
      //客户变更申请
      this.isAcc = false;
      this.isAccApply = true;
      this.isSolution = false;
    }else{
      //Solution方案 this.objectApiName==='Solution_Programme__c'
      this.isAcc = false;
      this.isAccApply = false;
      this.isSolution = true;
    }
    if(this.objectApiName==='Account'||this.objectApiName==='Account_Delay_Apply__c'||this.objectApiName==='Solution_Programme__c'){
      getInitData({ recordId: this.recordId,objectApiName:this.objectApiName})
      .then(result => {
          this.obj =  JSON.parse(result.objJson);
          // if(this.objectApiName==='Account'){
              console.log('handleUserInfo');
              var userProfileId = result.currentUserProfileId;
              this.nodeName = result.nodeName;
              console.log(this.nodeName + '<===this.nodeName');
              console.log(userProfileId);
              console.log(ProfileId_SystemAdmin);
              console.log(ProfileId_2J3);
              if(userProfileId===ProfileId_SystemAdmin){
                this.isadmin = true;
              }else{
                this.isadmin = false;
              }
              if(userProfileId===ProfileId_2J3){
                this.isdealers = true;
              }else{
                this.isdealers = false;
              }
              console.log(this.isadmin);
              console.log(this.isdealers);
              if(!this.isadmin && !this.isdealers) {
                console.log('双非锁定');
                this.RejectionReasonDis = true;
                this.AssociatedHospitalDis = true;
                this.InstitutionalTypeDis = true;
                this.HospitalTypeDis = true;
                this.WhetherRiskPassingDis = true;
              }else if(this.isadmin && !this.isdealers){
                console.log('测试执行');
                this.RejectionReasonDis = false;
                this.AssociatedHospitalDis = true;
                this.InstitutionalTypeDis = true;
                if (this.objectApiName==='Account_Delay_Apply__c') {
                    this.InstitutionalTypeDis = false;
                    this.HospitalTypeDis = true;
                    this.WhetherRiskPassingDis = true;
                }else{
                    this.InstitutionalTypeDis = true;
                    this.HospitalTypeDis = false;
                    this.WhetherRiskPassingDis = true;
                }
              }else if (this.isdealers) {
                this.RejectionReasonDis = false;
                this.AssociatedHospitalDis = true;
                if (this.objectApiName==='Account_Delay_Apply__c') {
                    this.InstitutionalTypeDis = true;
                    this.HospitalTypeDis = true;
                    this.WhetherRiskPassingDis = false;
                }else{
                    this.InstitutionalTypeDis = true;
                    this.HospitalTypeDis = false;
                    this.WhetherRiskPassingDis = false;
                }
              }
          // }
      }).catch(error => {
          console.error('Error loading report: ', error);
      });
    }
  }
  //decides if it will show the menu that may two buttons, the recall and the reassign
  get showButtonMenu() {
    return (
      this.approvalHistory.isCurrentUserApprover ||
      this.approvalHistory.showRecall
    );
  }
  //decides if it will show the submit for approval button
  get showSubmitForApprovalButton() {
    return this.approvalHistory &&
      this.approvalHistory.showSubmitForApproval &&
      this.allowSubmitForApproval
      ? true
      : false;
  }
  //will return a different modal title depending on the state
  get modalTitle() {
    if (this.currentModalState && modalStates[this.currentModalState])
      return modalStates[this.currentModalState].title;
    return "";
  }
  // will return a different label for the submit button, depending on the current state.(Approve, Reject, Submit, etc)
  get modalsubmitLabel() {
    if (this.currentModalState && modalStates[this.currentModalState])
      return modalStates[this.currentModalState].submitLabel;
    return "";
  }
  // decides if the comment input field will show in the modal, based on the current state
  get showCommentModal() {
    return (
      this.currentModalState === modalStates.SUBMIT_APPROVAL.state ||
      this.currentModalState === modalStates.APPROVE.state ||
      this.currentModalState === modalStates.REJECT.state ||
      this.currentModalState === modalStates.RECALL.state
    );
  }
  // decides if the lookup component will show in the modal, based on the current state
  get showLookupModal() {
    return (
      this.currentModalState === modalStates.GET_NEXT_APPROVER_SUBMIT.state ||
      this.currentModalState === modalStates.REASSIGN.state ||
      this.currentModalState === modalStates.GET_NEXT_APPROVER_APPROVE.state
    );
  }
  // decides the label for the lookup component, based on the current state
  get lookupLabel() {
    return modalStates[this.currentModalState].lookupLabel;
  }
  get showDataTable() {
    return this.approvalHistory && this.approvalHistory.approvalSteps.length > 0
      ? true
      : false;
  }
  @wire(getApprovalHistory, { recordId: "$recordId" })
  wiredGetApprovalHist(value) {
    this.wiredApprovalHistory = value;
    if (value.data) {
      this.approvalHistory = value.data;
      console.log('wiredGetApprovalHist');
      console.log(JSON.stringify(this.approvalHistory));
    } else if (value.error) {
      displayToastErrorQuery(this, ShowToastEvent);
    }
  }
  refreshApprovalHistory() {
    console.log('refreshApprovalHistory');
    refreshApex(this.wiredApprovalHistory);
    console.log('/lightning/r/'+this.objectApiName+'/'+this.recordId+'/view');
    window.location.href = '/lightning/r/'+this.objectApiName+'/'+this.recordId+'/view';
  }
  @api
  submitForApproval(){
    this.handleSubmitForApprovalClick();
  }
  //button click handlers
  //the handlers show the modal and change the currentModalState depending on the button clicked
  handleSubmitForApprovalClick() {
    console.log('handleSubmitForApprovalClick');
    showModal(this);
    this.currentModalState = modalStates.SUBMIT_APPROVAL.state;
  }
  handleReassignClick() {
    showModal(this);
    this.isShow = false;
    this.currentModalState = modalStates.REASSIGN.state;
  }
  handleRecallClick() {
    showModal(this);
    this.isShow = false;
    this.currentModalState = modalStates.RECALL.state;
  }
handleApproveClick1() {
  this.isLoading=true;
}
  handleApproveClick() {
    this.inputFieldStyle ='display: none;';
    this.inputFieldStyleTwo = 'display: block;';
    // this.inputFieldStyleThree = 'display: none;';
    // this.inputFieldStyleFour = 'display: block;';
    if(this.objectApiName==='Account'){
      var InsType = this.obj.InstitutionalType__c;
      if (this.nodeName.indexOf('医院新建审批_事业推进部')!=-1) {
        this.RejectionReasonDis = false;
        this.InstitutionalTypeDis = false;
        console.log('InsType='+InsType);
        if(InsType=== '非医疗机构'){
          this.HospitalTypeDis = false;
        }else{
          this.HospitalTypeDis = true;
        }
      }
      if (this.isdealers) {
        this.RejectionReasonDis = true;
        this.AssociatedHospitalDis = true;
        this.InstitutionalTypeDis = true;
        this.HospitalTypeDis = true;
        this.WhetherRiskPassingDis = false;
      }else{
        this.WhetherRiskPassingDis = true;
      }
    }
    if(this.objectApiName==='Account_Delay_Apply__c'){
      var InsType = this.obj.InstitutionalType__c;
      console.log('InsType='+InsType);
      if (this.nodeName.indexOf('医院变更审批_事业推进部')!=-1) {
        if(InsType== '非医疗机构'){
          this.HospitalTypeDis = false;
        }else{
          this.HospitalTypeDis = true;
        }
        if (this.isdealers) {
          this.WhetherRiskPassingDis = false;
        }else{
          this.WhetherRiskPassingDis = true;
        }
      }
    }
    showModal(this);
    this.isShow = true;
    this.currentModalState = modalStates.APPROVE.state;
  }
  handleRejectClick() {
    this.inputFieldStyle = 'display: block;';
    this.inputFieldStyleTwo = 'display: none;';
    // this.inputFieldStyleThree = 'display: block;';
    // this.inputFieldStyleFour = 'display: none;';
    if(this.objectApiName==='Account'){
      if (this.nodeName.indexOf('医院新建审批_事业推进部')!=-1) {
        this.InstitutionalTypeDis = false;
        var InsType = this.InstitutionalTypeDis;
        if(InsType=== '非医疗机构'){
          this.HospitalTypeDis = false;
        }else{
          this.HospitalTypeDis = true;
        }
        if (this.isdealers) {
          this.RejectionReasonDis = true;
          this.AssociatedHospitalDis = true;
          this.InstitutionalTypeDis = true;
          this.HospitalTypeDis = true;
          this.WhetherRiskPassingDis = false;
        }else{
          this.WhetherRiskPassingDis = true;
        }
      }
    }
    if(this.objectApiName==='Account_Delay_Apply__c'){
      if (this.nodeName.indexOf('医院变更审批_事业推进部')!=-1) {
        var InsType = this.obj.InstitutionalType__c;
          if(InsType=== '非医疗机构'){
            this.HospitalTypeDis = false;
          }else{
            this.HospitalTypeDis = true;
          }
        if (this.isdealers) {
          this.WhetherRiskPassingDis = false;
        }else{
          this.WhetherRiskPassingDis = true;
        }
      }
    }
    showModal(this);
    this.isShow = true;
    this.currentModalState = modalStates.REJECT.state;
  }
  //end button click handlers
  //this function submits for approval, if a next approver is needed,
  //it will show the next approver modal which will trigger the submition again.
  submitForApprovalApexCall() {
    hideModal(this);
    this.isLoading=true;
    submitForApprovalApex({
      recordId: this.recordId,
      comments: this.modalComment,
      nextApproverId: this.selectedUser
    })
      .then(result => {
        let jsonResult = JSON.parse(result);
        if (jsonResult.success) {
          displayToast(this, ShowToastEvent, SUCCESS);
          this.refreshApprovalHistory();
        } else {
          displayToast(this, ShowToastEvent, ERROR);
        }
        clearModalState(this);
      })
      .catch(error => {
        if (verifyIfNextApproverWasNeeded(error.body.pageErrors)) {
          showGetNextApproverModal(this, modalStates.GET_NEXT_APPROVER_SUBMIT.state);
        } else {
          let errorMessage = extractErrorMessage(error.body.pageErrors);
          displayToast(this, ShowToastEvent, ERROR, errorMessage);
          clearModalState(this);
        }
      });
  }
  //function that takes care of reassigning the pending step to the selected user.
  reassignApexCall() {
    hideModal(this);
    reassignStep({ recordId: this.recordId, newActorId: this.selectedUser })
      .then(() => {
        displayToast(this, ShowToastEvent, SUCCESS);
        clearModalState(this);
        this.refreshApprovalHistory();
      })
      .catch(() => {
        displayToast(this, ShowToastEvent, ERROR);
        clearModalState(this);
      });
  }
  //function that takes care of approve, reject, and recall. If next approver is needed
  //it will show the next approver modal which will trigger the submition again.
  processStepApexCall(action) {
    console.log('processStepApexCall');
    hideModal(this);
    this.isLoading=true;
    processStep({
      recordId: this.recordId,
      comments: this.modalComment,
      nextApproverId: this.selectedUser,
      action: action,
      objApiName:this.objectApiName,
      modalsubmitLabel:this.modalsubmitLabel,
      objJson:JSON.stringify(this.obj)
    })
      .then(result => {
        console.log('then');
        console.log(result);
        let jsonResult = JSON.parse(result);
        console.log(jsonResult);
        console.log(jsonResult.success);
        if (jsonResult.success) {
          // displayToast(this, ShowToastEvent, SUCCESS);
          this.isLoading=false;
          if (this.modalsubmitLabel=='批准') {
            this.showToast('success','批准完成');
          }else{
            this.showToast('success','驳回完成');
          }
          setTimeout(() => {
                this.refreshApprovalHistory();
            }, 3000);
        } else {
          if(jsonResult.returnMes){
            this.showToast('error',jsonResult.returnMes);
              // window.location.href = '/lightning/r/'+this.objectApiName+'/'+this.recordId+'/view';
             setTimeout(() => {
                window.location.href = '/lightning/r/' + this.objectApiName + '/' + this.recordId + '/view';
            }, 3000);
          }else{
            displayToast(this, ShowToastEvent, ERROR);
              // window.location.href = '/lightning/r/'+this.objectApiName+'/'+this.recordId+'/view';
            setTimeout(() => {
                window.location.href = '/lightning/r/' + this.objectApiName + '/' + this.recordId + '/view';
            }, 3000);
          }
        }
        clearModalState(this);
      })
      .catch(error => {
        console.log('error');
        if (verifyIfNextApproverWasNeeded(error.body.pageErrors)) {
          showGetNextApproverModal(this, modalStates.GET_NEXT_APPROVER_APPROVE.state);
        } else {
          let errorMessage = extractErrorMessage(error.body.pageErrors);
          displayToast(this, ShowToastEvent, ERROR, errorMessage);
          clearModalState(this);
          setTimeout(() => {
                window.location.href = '/lightning/r/' + this.objectApiName + '/' + this.recordId + '/view';
            }, 3000);
          // window.location.href = '/lightning/r/'+this.objectApiName+'/'+this.recordId+'/view';
        }
      });
  }
  handleModalCancel() {
    hideModal(this);
    clearModalState(this);
  }
  //function that handles the modal Submit button.
  //depending on the current state, it will call the appropriate imperative method
  handleModalSubmit() {
    if(this.isShow&&(this.isAcc||this.isAccApply||this.isSolution)){
      //先提交其他字段的填写
      var today = new Date();
      console.log('------------');
      console.log(this.objectApiName);
      console.log(this.recordId);
      console.log(this.isSolution);
      console.log(this.modalsubmitLabel);
      console.log(this.currentModalState);
      console.log(JSON.stringify(this.obj));
      // return;
      // if(this.isAcc){
      //   if(this.modalsubmitLabel === '批准' || this.modalsubmitLabel === '拒绝'){
      //     //== '步骤:医院新建审批_营业支援部(等待处理的 首先 批准)'
      //     if(testlink.contains('医院新建审批_营业支援部') ){
      //         if(this.modalsubmitLabel === '批准'){
      //             if(!this.stringIsEmpty(this.obj.RejectionReason__c)){
      //                 this.showToast('error', '您已填写驳回理由,批准不需要驳回理由。');
      //                 hideModal(this);
      //                 return;
      //             }
      //             if(this.stringIsEmpty(this.obj.InstitutionalType__c)){
      //                 this.showToast('error', '批准前,机构类型必填。');
      //                 hideModal(this);
      //                 return;
      //             }
      //             if(this.obj.InstitutionalType__c === '非医疗机构' && this.stringIsEmpty(this.obj.HospitalType__c)){
      //                 this.showToast('error', '非医疗机构请选择医院类型。');
      //                 hideModal(this);
      //                 return;
      //             }
      //             if(this.obj.InstitutionalType__c === '医疗机构' && !this.stringIsEmpty(this.obj.HospitalType__c)){
      //                 this.showToast('error', '医疗机构不需要选择医院类型。');
      //                 hideModal(this);
      //                 return;
      //             }
      //             if(this.obj.InstitutionalType__c === '医疗机构'){
      //                 this.obj = {
      //                   ...this.obj,
      //                   ['Is_Active__c']: '有効'
      //                 };
      //                 this.obj = {
      //                   ...this.obj,
      //                   ['Approved_Confirm_Date__c']: today
      //                 };
      //             }
      //         }
      //         //拒绝
      //         if(this.modalsubmitLabel === '拒绝'){
      //             if(this.stringIsEmpty(this.obj.RejectionReason__c)){
      //                 this.showToast('error', '拒绝前,请选择驳回理由。');
      //                 hideModal(this);
      //                 return;
      //             }
      //             if(this.obj.RejectionReason__c === '重复' && this.stringIsEmpty(this.obj.AssociatedHospital__c)){
      //                 this.showToast('error', '驳回理由是重复的,请填写关联医院。');
      //                 hideModal(this);
      //                 return;
      //             }
      //             if(this.obj.RejectionReason__c !== '重复' && !this.stringIsEmpty(this.obj.AssociatedHospital__c)){
      //                 this.showToast('error', '驳回理由不是重复的,不能填写关联医院。');
      //                 hideModal(this);
      //                 return;
      //             }
      //             if(!this.stringIsEmpty(this.obj.RejectionReason__c) && (!this.stringIsEmpty(this.obj.InstitutionalType__c)||!this.stringIsEmpty(this.obj.HospitalType__c))){
      //                 this.showToast('error', '审批拒绝,不允许填写机构类型或医院类型。');
      //                 hideModal(this);
      //                 return;
      //             }
      //             if(this.obj.RejectionReason__c === '医院已关张' || this.obj.RejectionReason__c === '重复'){
      //                 this.obj = {
      //                   ...this.obj,
      //                   ['Is_Active__c']: '驳回'
      //                 };
      //             }else{
      //                 this.obj = {
      //                   ...this.obj,
      //                   ['Is_Active__c']: '草案中'
      //                 };
      //             }
      //         }
      //     }else if(testlink.contains('质量法规二级部长') ){
      //         if(this.modalsubmitLabel === '批准'){
      //            if(this.obj.InstitutionalType__c === '非医疗机构' && this.obj.HospitalType__c === '高等院校'){
      //               this.obj = {
      //                 ...this.obj,
      //                 ['Is_Active__c']: '有効'
      //               };
      //               this.obj = {
      //                 ...this.obj,
      //                 ['Approved_Confirm_Date__c']: today
      //               };
      //            }
      //         }
      //         if(this.modalsubmitLabel === '拒绝'){
      //             this.obj = {
      //               ...this.obj,
      //               ['Is_Active__c']: '驳回'
      //             };
      //          }
      //      }else if(testlink.contains('经销商管理部一级审批')){
      //         if(this.modalsubmitLabel === '批准'){
      //             if(this.stringIsEmpty(this.obj.WhetherRiskPassing__c)){
      //                 this.showToast('error', '是否为有风险通过 必填。');
      //                 hideModal(this);
      //                 return;
      //             }
      //            if(this.obj.InstitutionalType__c === '非医疗机构' && this.obj.HospitalType__c === '企业集团' && this.obj.WhetherRiskPassing__c === '否'){
      //               this.obj = {
      //                 ...this.obj,
      //                 ['Is_Active__c']: '有効'
      //               };
      //               this.obj = {
      //                 ...this.obj,
      //                 ['Approved_Confirm_Date__c']: today
      //               };
      //            }
      //         }
      //          if(this.modalsubmitLabel == '拒绝'){
      //             this.obj = {
      //               ...this.obj,
      //               ['Is_Active__c']: '驳回'
      //             };
      //          }
      //     }else if(testlink.contains('总经理审批')){
      //         if(this.modalsubmitLabel === '批准'){
      //             this.obj = {
      //               ...this.obj,
      //               ['Is_Active__c']: '有効'
      //             };
      //             this.obj = {
      //               ...this.obj,
      //               ['Approved_Confirm_Date__c']: today
      //             };
      //         }
      //         if(this.modalsubmitLabel === '拒绝'){
      //             this.obj = {
      //               ...this.obj,
      //               ['Is_Active__c']: '驳回'
      //             };
      //         }
      //     }else{
      //         if(this.modalsubmitLabel === '拒绝'){
      //             this.obj = {
      //               ...this.obj,
      //               ['Is_Active__c']: '驳回'
      //             };
      //          }
      //     }
      //  }
      // }
      if(this.isSolution){
        if(this.obj.Confirmation_Result__c){
        }else{
          this.showToast('error', '必须填写反馈结果!');
          hideModal(this);
          return;
        }
      }
      // this.handleSubmit();
      // saveRecord({objectApiName:this.objectApiName,objId:this.recordId,objJson:JSON.stringify(this.obj)})
      //     .then(result => {
            this.handleSubmit();
      //       hideModal(this);
      //       return;
      //     })
      //     .catch(error => {
      //       hideModal(this);
      //       this.showToast('error', error);
      //       return;
      //     });
    }else{
      this.handleSubmit();
    }
  }
  showToast(variant,mes) {
    const event = new ShowToastEvent({
        message: mes,
        variant: variant,
    });
    this.dispatchEvent(event);
    this.dispatchEvent(new CloseActionScreenEvent());
    return;
  }
  handleSubmit(){
    console.log('handleSubmit');
    switch (this.currentModalState) {
      case modalStates.SUBMIT_APPROVAL.state:
        this.modalComment = getCommentPropertyFromModal(this);
        this.submitForApprovalApexCall();
        break;
      case modalStates.GET_NEXT_APPROVER_SUBMIT.state:
        if (validateUserLookup(this)) {
          setSelectedUser(this);
          this.submitForApprovalApexCall();
        }
        break;
      case modalStates.REASSIGN.state:
        if (validateUserLookup(this)) {
          setSelectedUser(this);
          this.reassignApexCall();
        }
        break;
      case modalStates.APPROVE.state:
        this.modalComment = getCommentPropertyFromModal(this);
        this.processStepApexCall(modalStates.APPROVE.action);
        break;
      case modalStates.GET_NEXT_APPROVER_APPROVE.state:
        if (validateUserLookup(this)) {
          setSelectedUser(this);
          this.processStepApexCall(modalStates.APPROVE.action);
        }
        break;
      case modalStates.RECALL.state:
        this.modalComment = getCommentPropertyFromModal(this);
        this.processStepApexCall(modalStates.RECALL.action);
        break;
      case modalStates.REJECT.state:
        console.log('1');
        this.modalComment = getCommentPropertyFromModal(this);
        console.log('2');
        this.processStepApexCall(modalStates.REJECT.action);
        console.log('3');
        break;
      default:
        break;
    }
  }
  //searches the users based on the lookup component search event.
  handleLookupSearch(event) {
    searchUsers(event.detail)
      .then(results => {
        this.template.querySelector("c-lookup").setSearchResults(results);
      })
      .catch(error => {
        this.lookupErrors = [error];
      });
  }
  handleSelectionChange() {
    this.lookupErrors = [];
  }
  stringIsEmpty(str) {
    if (str === '' || str === undefined || str === null) {
        return true;
    } else {
        return false;
    }
  }
}
force-app/main/default/lwc/approvalHistoryLWC/approvalHistoryLWC.js-meta.xml
New file
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" ?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>48.0</apiVersion>
    <isExposed>true</isExposed>
    <masterLabel>Approval History</masterLabel>
    <description>This component executes the same as the Approval History related list.</description>
    <targets>
      <target>lightning__RecordPage</target>
      <target>lightning__AppPage</target>
      <target>lightning__HomePage</target>
      <target>lightning__RecordAction</target>
    </targets>
    <targetConfigs>
      <targetConfig targets="lightning__RecordPage">
        <property
        name="allowSubmitForApproval"
        type="Boolean"
        label="Allow Submit For Approval"
      />
      <property
        name="showComments"
        type="Boolean"
        label="Show Comments"
      />
      <property
            name="objectApiName"
            type="String"
            label="Object Name"
            description="Automatically bind the page's object name to the component variable"
            default="{!objectApiName}" />
       <supportedFormFactors>
          <supportedFormFactor type="Small" />
          <supportedFormFactor type="Large" />
      </supportedFormFactors>
      </targetConfig>
    </targetConfigs>
</LightningComponentBundle>
force-app/main/default/lwc/approvalHistoryLWC/approvalHistoryUtil.js
New file
@@ -0,0 +1,264 @@
const COMMENT_DATA_FIELD = "comment";
const USER_REQUIRED_ERROR_MESSAGE = "You must select a user before submitting.";
//constant used to store the toast error information if there is an error
//querying the approval history
const queryError = {
  title: "Error!",
  message:
    "There was an error while fetching the Approval History. Please contact your System Administrator.",
  variant: "error"
};
//stores every possible modal state with all properties associated to each state
//this stores the success/error toast message information, the Modal titles, and the submit buttons
export const modalStates = {
  SUBMIT_APPROVAL: {
    state: "SUBMIT_APPROVAL",
    // title: "Submit for Approval",
    title: "提交审批",
    // submitLabel: "Submit",
    submitLabel: "提交",
    toastInfo: {
      success: {
        label: "success",
        title: "Success!",
        message: "Approval Process submitted.",
        variant: "success"
      },
      error: {
        label: "error",
        title: "Error!",
        message:
          "There was an error while submitting the Approval Process. Please contact your System Administrator.",
        variant: "error"
      }
    }
  },
  GET_NEXT_APPROVER_SUBMIT: {
    state: "GET_NEXT_APPROVER_SUBMIT",
    // title: "Submit for Approval",
    title: "提交审批",
    // submitLabel: "Submit",
    submitLabel: "提交",
    lookupLabel: "Choose Next Approver",
    toastInfo: {
      success: {
        label: "success",
        title: "Success!",
        message: "Approval Process submitted.",
        variant: "success"
      },
      error: {
        label: "error",
        title: "Error!",
        message:
          "There was an error while submitting the Approval Process. Please contact your System Administrator.",
        variant: "error"
      }
    }
  },
  APPROVE: {
    state: "APPROVE",
    title: "批准",
    // submitLabel: "Approve",
    submitLabel: "批准",
    action: "Approve",
    toastInfo: {
      success: {
        label: "success",
        title: "Success!",
        message: "The step was approved successfully.",
        variant: "success"
      },
      error: {
        label: "error",
        title: "Error!",
        message:
          "There was an error while approving the step. Please contact your System Administrator.",
        variant: "error"
      }
    }
  }, //want to get sobject type like Approve Account
  GET_NEXT_APPROVER_APPROVE: {
    state: "GET_NEXT_APPROVER_APPROVE",
    title: "批准",
    // submitLabel: "Approve",
    submitLabel: "批准",
    lookupLabel: "Choose Next Approver",
    toastInfo: {
      success: {
        label: "success",
        title: "Success!",
        message: "The step was approved successfully.",
        variant: "success"
      },
      error: {
        label: "error",
        title: "Error!",
        message:
          "There was an error while approving the step. Please contact your System Administrator.",
        variant: "error"
      }
    }
  }, //want to get sobject type like Approve Account
  REJECT: {
    state: "REJECT",
    title: "拒绝",
    // submitLabel: "Reject",
    submitLabel: "拒绝",
    action: "Reject",
    toastInfo: {
      success: {
        label: "success",
        title: "Success!",
        message: "The step was rejected successfully.",
        variant: "success"
      },
      error: {
        label: "error",
        title: "Error!",
        message:
          "There was an error while rejecting the step. Please contact your System Administrator.",
        variant: "error"
      }
    }
  }, //want to get sobject type like Reject Account
  RECALL: {
    state: "RECALL",
    // title: "Recall Approval Request",
    title: "撤回批准请求",
    // submitLabel: "Recall",
    submitLabel: "撤回",
    action: "Removed",
    toastInfo: {
      success: {
        label: "success",
        title: "Success!",
        message: "The step was recalled successfully.",
        variant: "success"
      },
      error: {
        label: "error",
        title: "Error!",
        message:
          "There was an error while recalling the step. Please contact your System Administrator.",
        variant: "error"
      }
    }
  }, //want to get sobject type like Reject Account
  REASSIGN: {
    state: "REASSIGN",
    // title: "Reassign Approval Request",
    title: "重新分配审批请求",
    // submitLabel: "Reassign",
    submitLabel: "重新分配",
    lookupLabel: "Reassign To",
    toastInfo: {
      success: {
        label: "success",
        title: "Success!",
        message: "Approval process step was reassigned.",
        variant: "success"
      },
      error: {
        label: "error",
        title: "Error!",
        message:
          "There was an error while reassigning the approval process step. Please contact your System Administrator.",
        variant: "error"
      }
    }
  } //want to get sobject type like Reject Account
};
//error message that indicates the next approver is missing
const MISSING_NEXT_APPROVER_ERROR = "missing required field: [nextApproverIds]";
//function called after error message from an imperative method,
//to verify if a next approver is needed
export function verifyIfNextApproverWasNeeded(errors) {
  const missingNextApprover = error =>
    error.message === MISSING_NEXT_APPROVER_ERROR;
  return errors.some(missingNextApprover);
}
//modal helper functions
export function hideModal(self) {
  let modalToHide = self.template.querySelector("c-modal");
  modalToHide.hide();
}
export function showModal(self) {
  let modalToShow = self.template.querySelector("c-modal");
  modalToShow.show();
}
//end modal helper functions
export function getCommentPropertyFromModal(self) {
  console.log('getCommentPropertyFromModal');
  return self.template.querySelector(`[data-id="${COMMENT_DATA_FIELD}"]`).value;
}
export function showGetNextApproverModal(self, newState) {
  self.currentModalState = newState;
  showModal(self);
}
//if a user was not selected in the lookup
//populate the error message
export function validateUserLookup(self) {
  const selection = self.template.querySelector("c-lookup").getSelection();
  if (selection.length === 0) {
    self.lookupErrors = [{ message: USER_REQUIRED_ERROR_MESSAGE }];
    return false;
  }
  self.lookupErrors = [];
  return true;
}
//populates the selected user property based on the selected
//user in the lookup component
export function setSelectedUser(self) {
  self.selectedUser = self.template
    .querySelector("c-lookup")
    .getSelection()[0].id;
}
export function clearModalState(self) {
  self.currentModalState = "";
  self.selectedUser = "";
  self.lookupErrors = [];
  self.modalComment = "";
  self.initialSelection = [];
}
//displays a toast based on the current modal state and on the status=success/error
export function displayToast(self, ShowToastEvent, status, messageOverride) {
  const event = new ShowToastEvent({
    title: modalStates[self.currentModalState].toastInfo[status].title,
    message: messageOverride
      ? messageOverride
      : modalStates[self.currentModalState].toastInfo[status].message,
    variant: modalStates[self.currentModalState].toastInfo[status].variant
  });
  self.dispatchEvent(event);
}
export function displayToastErrorQuery(self, ShowToastEvent) {
  const event = new ShowToastEvent({
    title: queryError.title,
    message: queryError.message,
    variant: queryError.variant
  });
  self.dispatchEvent(event);
}
export function extractErrorMessage(errors) {
  let errorMessage = "";
  errors.forEach(element => {
    errorMessage += element.message;
  });
  return errorMessage;
}
force-app/main/default/lwc/approvalLookUp/approvalLookUp.css
New file
@@ -0,0 +1,30 @@
.slds-combobox__input,
.slds-combobox_container {
  transition: border 0.1s linear, box-shadow 0.1 linear;
}
.slds-combobox__input {
  box-shadow: none;
}
.slds-combobox__input.has-custom-border {
  box-shadow: 0 0 0 2px #fff inset, 0 0 0 3px rgb(221, 219, 218) inset;
}
.slds-combobox__input.has-custom-error {
  border: 1px solid rgb(194, 57, 52);
  box-shadow: rgb(194, 57, 52) 0 0 0 1px inset;
}
.slds-combobox_container.has-custom-error {
  border: none !important;
}
.slds-combobox__input.has-custom-height {
  height: 32px !important;
}
.form-error {
  color: rgb(194, 57, 52);
  display: block;
}
force-app/main/default/lwc/approvalLookUp/approvalLookUp.html
New file
@@ -0,0 +1,189 @@
<template>
    <div class="slds-form-element">
      <label if:true={label} class="slds-form-element__label" for="combobox">
        <abbr if:true={required} title="required" class="slds-required">*</abbr>
        {label}
      </label>
      <div class="slds-form-element__control">
        <div class={getContainerClass}>
          <div
            class={getDropdownClass}
            aria-expanded={isExpanded}
            aria-haspopup="listbox"
            role="combobox"
          >
            <!-- Search input start -->
            <div class={getComboboxClass} role="none">
              <template if:false={isMultiEntry}>
                <lightning-icon
                  icon-name={getSelectIconName}
                  size="small"
                  alternative-text="Selected item icon"
                  class={getSelectIconClass}
                >
                </lightning-icon>
              </template>
              <!-- Text input -->
              <input
                type="text"
                class={getInputClass}
                aria-autocomplete="list"
                aria-controls="listbox"
                autocomplete="off"
                role="textbox"
                id="combobox"
                placeholder={placeholder}
                value={getInputValue}
                title={getInputTitle}
                readonly={isInputReadonly}
                onfocus={handleFocus}
                onblur={handleBlur}
                oninput={handleInput}
              />
              <!-- Search icon -->
              <lightning-icon
                icon-name="utility:search"
                size="x-small"
                alternative-text="Search icon"
                class={getSearchIconClass}
              ></lightning-icon>
              <!-- Clear selection button icon for single entry lookups -->
              <template if:false={isMultiEntry}>
                <button
                  title="Remove selected option"
                  type="button"
                  onclick={handleClearSelection}
                  class={getClearSelectionButtonClass}
                >
                  <lightning-icon
                    icon-name="utility:close"
                    size="x-small"
                    alternative-text="Remove selected option"
                    class="slds-button__icon"
                  ></lightning-icon>
                </button>
              </template>
            </div>
            <!-- Search input end -->
            <!-- Result list box start -->
            <div id="listbox" role="listbox" onclick={handleComboboxClick}>
              <ul class={getListboxClass} role="presentation">
                <!-- Spinner to display when waiting for results of search -->
                <div if:true={loading}>
                  <lightning-spinner
                    alternative-text="Loading"
                    size="small"
                  ></lightning-spinner>
                </div>
                <!-- Display if results are present -->
                <template
                  for:each={searchResults}
                  for:item="result"
                  if:true={isExpanded}
                >
                  <li
                    key={result.id}
                    role="presentation"
                    class="slds-listbox__item"
                  >
                    <span
                      class="slds-media slds-listbox__option slds-listbox__option_entity slds-listbox__option_has-meta"
                      role="option"
                      onclick={handleResultClick}
                      data-recordid={result.id}
                    >
                      <span class="slds-media__figure">
                        <lightning-icon
                          icon-name={result.icon}
                          size="small"
                          alternative-text="Result item icon"
                        ></lightning-icon>
                      </span>
                      <span class="slds-media__body">
                        <span
                          class="slds-listbox__option-text slds-listbox__option-text_entity"
                        >
                          <lightning-formatted-rich-text
                            value={result.titleFormatted}
                            disable-linkify
                          >
                          </lightning-formatted-rich-text>
                        </span>
                        <span
                          class="slds-listbox__option-meta slds-listbox__option-meta_entity"
                        >
                          <lightning-formatted-rich-text
                            value={result.subtitleFormatted}
                            disable-linkify
                          >
                          </lightning-formatted-rich-text>
                        </span>
                      </span>
                    </span>
                  </li>
                </template>
                <!-- Display that there are no results -->
                <template if:false={isExpanded}>
                  <li role="presentation" class="slds-listbox__item">
                    <span
                      class="slds-media slds-listbox__option_entity"
                      role="option"
                    >
                      <span if:false={loading} class="slds-media__body">
                        No results.
                      </span>
                      <span if:true={loading} class="slds-media__body">
                        Loading...
                      </span>
                    </span>
                  </li>
                </template>
              </ul>
            </div>
            <!-- Result list box end -->
          </div>
        </div>
        <!-- Multi-selection start -->
        <template if:true={isMultiEntry}>
          <div id="selection" role="listbox" aria-orientation="horizontal">
            <ul
              class="slds-listbox slds-listbox_inline slds-var-p-top_xxx-small"
              role="group"
              aria-label="Selected Options:"
            >
              <template for:each={curSelection} for:item="item">
                <li key={item.id} role="presentation" class="slds-listbox__item">
                  <lightning-pill
                    label={item.title}
                    title={item.title}
                    onremove={handleRemoveSelectedItem}
                    name={item.id}
                  >
                    <lightning-icon icon-name={item.icon}></lightning-icon>
                  </lightning-pill>
                </li>
              </template>
            </ul>
          </div>
        </template>
        <!-- Multi-selection end -->
        <!-- Errors start -->
        <template for:each={errors} for:item="error">
          <label
            key={error.id}
            role="alert"
            class="slds-form-element__label slds-var-m-top_xx-small form-error"
            >{error.message}</label
          >
        </template>
        <!-- Errors end -->
      </div>
    </div>
  </template>
force-app/main/default/lwc/approvalLookUp/approvalLookUp.js
New file
@@ -0,0 +1,326 @@
import { LightningElement, api } from "lwc";
const MINIMAL_SEARCH_TERM_LENGTH = 2; // Min number of chars required to search
const SEARCH_DELAY = 300; // Wait 300 ms after user stops typing then, peform search
export default class Lookup extends LightningElement {
  @api label;
  @api required;
  @api placeholder = "";
  @api isMultiEntry = false;
  @api errors = [];
  @api scrollAfterNItems;
  searchTerm = "";
  searchResults = [];
  hasFocus = false;
  loading = false;
  isDirty = false;
  cleanSearchTerm;
  blurTimeout;
  searchThrottlingTimeout;
  curSelection = [];
  // EXPOSED FUNCTIONS
  @api
  set selection(initialSelection) {
    this.curSelection = Array.isArray(initialSelection)
      ? initialSelection
      : [initialSelection];
  }
  get selection() {
    return this.curSelection;
  }
  @api
  setSearchResults(results) {
    // Reset the spinner
    this.loading = false;
    // Clone results before modifying them to avoid Locker restriction
    const resultsLocal = JSON.parse(JSON.stringify(results));
    // Format results
    this.searchResults = resultsLocal.map(result => {
      // Clone and complete search result if icon is missing
      if (this.searchTerm.length > 0) {
        const regex = new RegExp(`(${this.searchTerm})`, "gi");
        result.titleFormatted = result.title
          ? result.title.replace(regex, "<strong>$1</strong>")
          : result.title;
        result.subtitleFormatted = result.subtitle
          ? result.subtitle.replace(regex, "<strong>$1</strong>")
          : result.subtitle;
      }
      if (typeof result.icon === "undefined") {
        const { id, sObjectType, title, subtitle } = result;
        return {
          id,
          sObjectType,
          icon: "standard:default",
          title,
          subtitle
        };
      }
      return result;
    });
  }
  @api
  getSelection() {
    return this.curSelection;
  }
  // INTERNAL FUNCTIONS
  updateSearchTerm(newSearchTerm) {
    this.searchTerm = newSearchTerm;
    // Compare clean new search term with current one and abort if identical
    const newCleanSearchTerm = newSearchTerm
      .trim()
      .replace(/\*/g, "")
      .toLowerCase();
    if (this.cleanSearchTerm === newCleanSearchTerm) {
      return;
    }
    // Save clean search term
    this.cleanSearchTerm = newCleanSearchTerm;
    // Ignore search terms that are too small
    if (newCleanSearchTerm.length < MINIMAL_SEARCH_TERM_LENGTH) {
      this.searchResults = [];
      return;
    }
    // Apply search throttling (prevents search if user is still typing)
    if (this.searchThrottlingTimeout) {
      clearTimeout(this.searchThrottlingTimeout);
    }
    // eslint-disable-next-line @lwc/lwc/no-async-operation
    this.searchThrottlingTimeout = setTimeout(() => {
      // Send search event if search term is long enough
      if (this.cleanSearchTerm.length >= MINIMAL_SEARCH_TERM_LENGTH) {
        // Display spinner until results are returned
        this.loading = true;
        const searchEvent = new CustomEvent("search", {
          detail: {
            searchTerm: this.cleanSearchTerm,
            selectedIds: this.curSelection.map(element => element.id)
          }
        });
        this.dispatchEvent(searchEvent);
      }
      this.searchThrottlingTimeout = null;
    }, SEARCH_DELAY);
  }
  isSelectionAllowed() {
    if (this.isMultiEntry) {
      return true;
    }
    return !this.hasSelection();
  }
  hasResults() {
    return this.searchResults.length > 0;
  }
  hasSelection() {
    return this.curSelection.length > 0;
  }
  // EVENT HANDLING
  handleInput(event) {
    // Prevent action if selection is not allowed
    if (!this.isSelectionAllowed()) {
      return;
    }
    this.updateSearchTerm(event.target.value);
  }
  handleResultClick(event) {
    const recordId = event.currentTarget.dataset.recordid;
    // Save selection
    let selectedItem = this.searchResults.filter(
      result => result.id === recordId
    );
    if (selectedItem.length === 0) {
      return;
    }
    selectedItem = selectedItem[0];
    const newSelection = [...this.curSelection];
    newSelection.push(selectedItem);
    this.curSelection = newSelection;
    this.isDirty = true;
    // Reset search
    this.searchTerm = "";
    this.searchResults = [];
    // Notify parent components that selection has changed
    this.dispatchEvent(new CustomEvent("selectionchange"));
  }
  handleComboboxClick() {
    // Hide combobox immediatly
    if (this.blurTimeout) {
      window.clearTimeout(this.blurTimeout);
    }
    this.hasFocus = false;
  }
  handleFocus() {
    // Prevent action if selection is not allowed
    if (!this.isSelectionAllowed()) {
      return;
    }
    this.hasFocus = true;
  }
  handleBlur() {
    // Prevent action if selection is not allowed
    if (!this.isSelectionAllowed()) {
      return;
    }
    // Delay hiding combobox so that we can capture selected result
    // eslint-disable-next-line @lwc/lwc/no-async-operation
    this.blurTimeout = window.setTimeout(() => {
      this.hasFocus = false;
      this.blurTimeout = null;
    }, 300);
  }
  handleRemoveSelectedItem(event) {
    const recordId = event.currentTarget.name;
    this.curSelection = this.curSelection.filter(item => item.id !== recordId);
    this.isDirty = true;
    // Notify parent components that selection has changed
    this.dispatchEvent(new CustomEvent("selectionchange"));
  }
  handleClearSelection() {
    this.curSelection = [];
    this.isDirty = true;
    // Notify parent components that selection has changed
    this.dispatchEvent(new CustomEvent("selectionchange"));
  }
  // STYLE EXPRESSIONS
  get getContainerClass() {
    let css = "slds-combobox_container slds-has-inline-listbox ";
    if (this.hasFocus && this.hasResults()) {
      css += "slds-has-input-focus ";
    }
    if (this.errors.length > 0) {
      css += "has-custom-error";
    }
    return css;
  }
  get getDropdownClass() {
    let css =
      "slds-combobox slds-dropdown-trigger slds-dropdown-trigger_click ";
    if (
      this.hasFocus &&
      this.cleanSearchTerm &&
      this.cleanSearchTerm.length >= MINIMAL_SEARCH_TERM_LENGTH
    ) {
      css += "slds-is-open";
    }
    return css;
  }
  get getInputClass() {
    let css = "slds-input slds-combobox__input has-custom-height ";
    if (
      this.errors.length > 0 ||
      (this.isDirty && this.required && !this.hasSelection())
    ) {
      css += "has-custom-error ";
    }
    if (!this.isMultiEntry) {
      css +=
        "slds-combobox__input-value " +
        (this.hasSelection() ? "has-custom-border" : "");
    }
    return css;
  }
  get getComboboxClass() {
    let css = "slds-combobox__form-element slds-input-has-icon ";
    if (this.isMultiEntry) {
      css += "slds-input-has-icon_right";
    } else {
      css += this.hasSelection()
        ? "slds-input-has-icon_left-right"
        : "slds-input-has-icon_right";
    }
    return css;
  }
  get getSearchIconClass() {
    let css = "slds-input__icon slds-input__icon_right ";
    if (!this.isMultiEntry) {
      css += this.hasSelection() ? "slds-hide" : "";
    }
    return css;
  }
  get getClearSelectionButtonClass() {
    return (
      "slds-button slds-button_icon slds-input__icon slds-input__icon_right " +
      (this.hasSelection() ? "" : "slds-hide")
    );
  }
  get getSelectIconName() {
    return this.hasSelection() ? this.curSelection[0].icon : "standard:default";
  }
  get getSelectIconClass() {
    return (
      "slds-combobox__input-entity-icon " +
      (this.hasSelection() ? "" : "slds-hide")
    );
  }
  get getInputValue() {
    if (this.isMultiEntry) {
      return this.searchTerm;
    }
    return this.hasSelection() ? this.curSelection[0].title : this.searchTerm;
  }
  get getInputTitle() {
    if (this.isMultiEntry) {
      return "";
    }
    return this.hasSelection() ? this.curSelection[0].title : "";
  }
  get getListboxClass() {
    return (
      "slds-listbox slds-listbox_vertical slds-dropdown slds-dropdown_fluid " +
      (this.scrollAfterNItems
        ? "slds-dropdown_length-with-icon-" + this.scrollAfterNItems
        : "")
    );
  }
  get isInputReadonly() {
    if (this.isMultiEntry) {
      return false;
    }
    return this.hasSelection();
  }
  get isExpanded() {
    return this.hasResults();
  }
}
force-app/main/default/lwc/approvalLookUp/approvalLookUp.js-meta.xml
New file
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<LightningComponentBundle
  xmlns="http://soap.sforce.com/2006/04/metadata"
  fqn="lookup"
>
    <apiVersion>48.0</apiVersion>
    <isExposed>false</isExposed>
</LightningComponentBundle>
force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.css
New file
@@ -0,0 +1,7 @@
.custom-date-input .slds-datepicker {
    /* 设置日期选择器的宽度 */
    width: 300px; /* 根据需要调整宽度 */
    /* 设置日期选择器的高度 */
    height: 300px; /* 根据需要调整高度 */
    /* 设置其他样式属性,如字体大小、边框、边框圆角等 */
  }
force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.html
@@ -74,6 +74,7 @@
    <!-- 改变日期 -->
    <div>
      <lightning-input 
        class="custom-date-input"
        type="date" 
        label="请选择要改变的日期" 
        name="aaa" 
@@ -86,6 +87,7 @@
    <div if:true={flg}>
      <lightning-input 
        class="custom-date-input"
        type="date" 
        label="预测发货日" 
        name="aa" 
force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.js
@@ -1,11 +1,15 @@
import { LightningElement, track  } from 'lwc';
import { api, wire,LightningElement } from 'lwc';
import GetOppinformationcData from '@salesforce/apex/ImprovedForecastTimeController.GetOppinformationcData';
import getReason from '@salesforce/apex/ImprovedForecastTimeController.getReason';
import SaveData from '@salesforce/apex/ImprovedForecastTimeController.SaveData';
import SystemModstamp from '@salesforce/schema/Account.SystemModstamp';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { CloseActionScreenEvent } from 'lightning/actions';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
import lexDateCss from '@salesforce/resourceUrl/lexDateCss';
export default class ImprovedForecastTime extends LightningElement {
    @api recordId;
    //显示与隐藏
    isAdvance = false;  //选着 提前 的标识
    isDelay = false; //选着 延后 的标识
@@ -99,8 +103,12 @@
    //初始化
    connectedCallback(){
        this.oppId = this.getQueryVariable('id');
        Promise.all([
            loadStyle(this, lwcCSS),
            loadStyle(this, lexDateCss)
           ]);
        this.oppId = this.recordId;
        console.log('oppId--' + this.oppId);
        GetOppinformationcData({ParamIdStr:this.oppId}).then(response=>{
            this.opp=JSON.parse(response);
@@ -136,10 +144,10 @@
        if (error) {
            this.TongzhiIcon = "standard:first_non_empty";
            this.BgColorStyle = "background-color:#f88568";
            this.BgColorStyle = "background-color:#ba0517";
        }else{
            this.TongzhiIcon = "standard:account";
            this.BgColorStyle = "background-color:#69e669";
            this.BgColorStyle = "background-color:#DD7A01";
        }
        if (left) {
            this.IsLeftStyle = "left: 0.25rem"
@@ -147,7 +155,25 @@
            this.IsLeftStyle = ""
        }
    }
    showToast(msg,type) {
        if(type == 'success'){
          const event = new ShowToastEvent({
            title: ' ',
            message: msg,
            variant: type
          });
          this.dispatchEvent(event);
        }else{
          const event = new ShowToastEvent({
            title: ' ',
            message: msg,
            variant: type,
            mode: 'sticky'
        });
        this.dispatchEvent(event);
        }
    }
    //关闭提示框
    CloseAlert(){
        this.closeOffRefresh();
@@ -212,24 +238,24 @@
        // if(this.opp.Date_InAdvance_Delay == '' ||this.opp.Date_InAdvance_Delay == undefined || this.opp.Predicted_date_ChangeReason == '' ||this.opp.Predicted_date_ChangeReason == undefined|| myDate5 == '' || myDate5 == undefined){
        if(!this.opp.Date_InAdvance_Delay || !this.opp.Predicted_date_ChangeReason ||  !this.opp.Close_Forecasted_Date){
        //SWAG-CJR4PC【委托】调查-修改预测日提前理由错误 fy end
            this.Alert("请选择日期/理由。",false,true);
            this.showToast("请选择日期/理由。","error");
        }
        else if(this.opp.Date_InAdvance_Delay == '提前' && (myDate5 >= myDate4 || myDate5 < myDate3)){
            this.Alert("请选择 “提前” 于当前预测OCSM签约日的日期 且 不早于今天。",false,true);
            this.showToast("请选择 “提前” 于当前预测OCSM签约日的日期 且 不早于今天。","error");
        }
        else if(this.opp.Date_InAdvance_Delay == '延后' && myDate5 <= myDate4){
            this.Alert("请选择 “延后” 于当前预测OCSM签约日的日期。",false,true);
            this.showToast("请选择 “延后” 于当前预测OCSM签约日的日期。","error");
        }
        else if(myDate7 < myDate5){
            this.Alert("预测发货日不能小于预测签约日。",false,true);
            this.showToast("预测发货日不能小于预测签约日。","error");
        }
        //20221226 lt DB202212359066增加限制-修改预测日最大日期 start
        else if(myDate5 > OrderDate){
            this.Alert("订货预测日请在未来三财年内。",false,true);
            this.showToast("订货预测日请在未来三财年内。","error");
        }
        else if(myDate7 > ShipmentsDate){
            this.Alert("发货预测日请在未来四财年内。",false,true);
            this.showToast("发货预测日请在未来四财年内。","error");
        }
        //20221226 lt DB202212359066增加限制-修改预测日最大日期 end
@@ -238,10 +264,15 @@
            SaveData({JsonData:JSON.stringify(this.opp)}).then((response)=>{
                if (response == '成功') {
                    this.OnLoading(false);
                    this.Alert("保存成功",false,true);
                    window.location.hash = "Refresh"+"=="+this.oppId;
                    this.showToast("保存成功","success");
                    // window.location.hash = "Refresh"+"=="+this.oppId;
                    const closeEvent = new CustomEvent('closeaction', {
                        bubbles: true, // 允许事件冒泡至父组件
                        composed: true, // 允许事件穿越 Shadow DOM 界限
                    });
                    this.dispatchEvent(closeEvent);
                }else{
                    this.Alert(response,true);
                    this.showToast(response,"error");
                }
            });
        }
force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.js-meta.xml
@@ -1,5 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>55.0</apiVersion>
    <isExposed>false</isExposed>
    <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/lexASACEditor/lexASACEditor.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-05-08 14:36:32
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-08-28 10:42:47
 * @LastEditTime: 2023-09-14 16:10:05
 */
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -12,6 +12,8 @@
import init  from '@salesforce/apex/ReportController.initForASACEditorButton';
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexASACEditor extends NavigationMixin(LightningElement) {
    @api recordId;
    lastModifiedDate
@@ -38,6 +40,10 @@
     }
    
    connectedCallback () {
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        console.log(this.recordId);
        init({
            recordId: this.recordId
force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-05-08 14:36:32
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-08-28 09:11:47
 * @LastEditTime: 2023-09-14 16:10:33
 */
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -12,6 +12,8 @@
import init  from '@salesforce/apex/ReportController.initForASRCEditorButton';
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexASRCEditor extends NavigationMixin(LightningElement) {
    @api recordId;
    lastModifiedDate
@@ -37,6 +39,10 @@
         }
     }
    connectedCallback () {
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        console.log(this.recordId);
        init({
            recordId: this.recordId
force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.css
@@ -1,4 +1,4 @@
.inASACEditorHolder{
/* .inASACEditorHolder{
    position: relative;
    display: inline-block;
    width: 80px;
@@ -7,4 +7,4 @@
}
.container .uiContainerManager{
    display: none !important;
}
} */
force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.html
@@ -9,7 +9,6 @@
<template>
    <div class="inASACEditorHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={showSuccess}></lightning-button>
        <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button>
    </div>
</template>
force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-04-12 14:51:44
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-05 15:47:38
 * @LastEditTime: 2023-10-04 12:28:54
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -20,6 +20,10 @@
import TradeComplianceStatusFlag from '@salesforce/label/c.TradeComplianceStatusFlag';
import IFTradeComplianceAlert from '@salesforce/label/c.IFTradeComplianceAlert';
import LightningConfirm from 'lightning/confirm';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
import queryQuote from '@salesforce/apex/OpportunityLightingButtonController.queryQuote';
export default class LexAgencyAuthorize extends LightningElement {
    @api recordId;
    agency1Id;
@@ -68,6 +72,9 @@
        }
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
@@ -118,14 +125,20 @@
        var oppid = this.recordId;
        var angency = this.agency1Id;
        var profileId = this.profileId;
         //测试已锁定授权合同申请为“1”
        this.estimationId = 'test';
        this.detailNum = 1;
        if (profileId != this.systemProfileId && profileId != this.j3ProfileId && profileId != this.s61ProfileId && profileId != this.s62ProfileId && profileId != this.m4ProfileId) {
            this.showToast("您没有授权申请的权限。请联系系统管理员。","error");
            return;
        }
        //贸易合规 you
        queryQuote({
            estimationId: this.estimationId
        }).then(result=>{
            console.log(result);
            if(result == true){
                this.showToast("包含虚拟产品,不能授权,请更新报价单后申请","error");
                return;
            }
             //贸易合规 you
        var AccDealerBlacklist = this.AccDealerBlacklist;//判断客户/经销商是否为黑名单
        var angency1 = this.angency1;
        var angency2 = this.angency2;
@@ -206,6 +219,10 @@
            this.ss();
        }
        //贸易合规 you
        });
    }
    ss(){
        if (this.stageName != '引合' && this.stageName != '询价' ) {
@@ -221,10 +238,11 @@
            this.showToast("耗材不可与奥辉产品同时存在!","error");
            return;
        } else if (this.cntLostCancelDraft > 0) {
            if(!confirm('询价有草案中的取消/失单报告,是否继续?')){
                this.dispatchEvent(new CloseActionScreenEvent());
                return ;
            }
            // if(!confirm('询价有草案中的取消/失单报告,是否继续?')){
            //     this.dispatchEvent(new CloseActionScreenEvent());
            //     return ;
            // }
            this.handleConfirmClick1("询价有草案中的取消/失单报告,是否继续?");
        } else if (this.cntLostCancelReport - this.cntLostCancelDraft > 0) {
            this.showToast('询价有已提交的取消/失单报告。',"error");
            return;
@@ -240,7 +258,13 @@
        }else if (this.ifSubmit == '1') {
            this.showToast('上传失败,请联系系统管理员!',"error");
            return;
        }else{
            this.dd();
        }
    }
    dd(){
        if (this.ifAuthorizingLock == true) {
            this.showToast('询价正在授权中,请不要重复提交。',"error");
            return;
@@ -290,11 +314,25 @@
            this.dispatchEvent(new CloseActionScreenEvent());
        }
    }
    async handleConfirmClick1(msg) {
        const result = await LightningConfirm.open({
            message: msg,
            variant: 'headerless',
            label: 'this is the aria-label value'
        });
        if (result) {
            this.dd();
        } else {
            this.dispatchEvent(new CloseActionScreenEvent());
        }
    }
    showToast(msg,type) {
        const event = new ShowToastEvent({
            title: '',
            message: msg,
            variant: type
            variant: type,
            mode: 'sticky'
        });
        this.dispatchEvent(event);
        this.dispatchEvent(new CloseActionScreenEvent());
force-app/main/default/lwc/lexApplyAgainLwc/lexApplyAgainLwc.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-09-09 13:31:12
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-11 14:43:12
 * @LastEditTime: 2023-09-14 16:09:41
 */
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -12,6 +12,8 @@
import init  from '@salesforce/apex/lexSolutionProjectRequirementsController.initForApplyAgainButton';
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexApplyAgainLwc extends NavigationMixin(LightningElement) {
    @api recordId;
@@ -33,6 +35,9 @@
         }
     }
     connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
force-app/main/default/lwc/lexAssignTaskButton/lexAssignTaskButton.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-05-15 11:14:32
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-04 13:16:23
 * @LastEditTime: 2023-09-21 17:13:37
 */
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -13,6 +13,8 @@
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import RECORD_TYPE_NAME_BY_INQUIRY_FOLLOW_UP from '@salesforce/label/c.RECORD_TYPE_NAME_BY_INQUIRY_FOLLOW_UP';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexAssignTaskButton extends NavigationMixin(LightningElement) {
    @api recordId;
    accountName;
@@ -35,6 +37,9 @@
         }
     }
     connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
@@ -75,17 +80,25 @@
            taskDifferent__c: '上级分配任务',
            Name: '*'
        });
        let states =
                {
                    nooverride: '1',
                    navigationLocation: 'LIST_VIEW',
                    // backgroundContext: '/lightning/o/Account/list?filterName=Recent&0.source=alohaHeader',
                    backgroundContext: '/lightning/r/Opportunity/'+this.recordId+'/view',
                    defaultFieldValues: defaultValues,
                };
            // states['recordTypeId'] =  this.recordTypeId;
        states['useRecordTypeCheck'] =  true;
        this[NavigationMixin.Navigate]({
            type: 'standard__objectPage',
            attributes: {
                objectApiName: 'task__c',
                actionName: 'new'
            },
            state: {
                nooverride: '1',
                defaultFieldValues: defaultValues,
                recordTypeId: this.recordTypeId
            }
            state: states
        });
        this.dispatchEvent(new CloseActionScreenEvent());
     }
force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.css
@@ -1,4 +1,4 @@
.lexBeforeOPDPDFBtnHolder{
/* .lexBeforeOPDPDFBtnHolder{
    position: relative;
    display: inline-block;
    width: 80px;
@@ -7,4 +7,4 @@
}
.container .uiContainerManager{
    display: none !important;
}
} */
force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.html
@@ -4,12 +4,11 @@
 * @Author: chen jing wu
 * @Date: 2023-04-13 15:08:43
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-04-14 14:13:25
 * @LastEditTime: 2023-09-23 12:22:45
-->
<template>
    <div class="lexBeforeOPDPDFBtnHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={showToast}></lightning-button>
        <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button>
    </div>
</template>
force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-04-13 15:08:43
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-08-25 16:41:24
 * @LastEditTime: 2023-09-14 16:11:28
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -14,6 +14,8 @@
import selectCommonSequence from '@salesforce/apex/ControllerUtil.selectCommonSequence';
import addReportOPWithEvaluationPDF from '@salesforce/apex/Add_Report.addReportOPWithEvaluationPDF';
import LightningConfirm from 'lightning/confirm';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexBeforeOPDPDFBtn extends LightningElement {
    @api recordId;
    accountId;
@@ -35,6 +37,9 @@
        }
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.css
@@ -1,4 +1,4 @@
.lexBeforeOPDPDFBtnSISHolder{
/* .lexBeforeOPDPDFBtnSISHolder{
    position: relative;
    display: inline-block;
    width: 80px;
@@ -7,4 +7,4 @@
}
.container .uiContainerManager{
    display: none !important;
}
} */
force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.html
@@ -9,6 +9,6 @@
<template>
    <div class="lexBeforeOPDPDFBtnSISHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={showSuccess}></lightning-button>
    </div>
</template>
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-09-11 15:50:12
 * @LastEditTime: 2023-09-14 16:11:51
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -13,7 +13,8 @@
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import selectCommonSequence from '@salesforce/apex/ControllerUtil.selectCommonSequence';
import addReportOPWithEvaluationPDF from '@salesforce/apex/Add_Report.addReportOPWithEvaluationPDF';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexBeforeOPDPDFBtnSIS extends LightningElement {
    @api recordId;
    accountId;
@@ -35,6 +36,9 @@
        }
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
force-app/main/default/lwc/lexCBLBPNewLwc/lexCBLBPNewLwc.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-07-28 15:58:45
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-08-10 14:27:50
 * @LastEditTime: 2023-09-14 16:15:00
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -14,7 +14,8 @@
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexCBLBPNewLwc extends NavigationMixin(LightningElement) {
    @api recordId;
    // @wire(CurrentPageReference)
@@ -33,6 +34,9 @@
    //     }
    // }
    connectedCallback(){
      Promise.all([
        loadStyle(this, lwcCSS)
       ]);
      this.CBLBPNewLwc();
    }
    CBLBPNewLwc(){
force-app/main/default/lwc/lexCancel/lexCancel.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-03-27 13:47:21
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-08-25 16:41:19
 * @LastEditTime: 2023-09-14 16:12:23
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -13,6 +13,8 @@
import updateForCancelButton  from '@salesforce/apex/ReportController.updateForCancelButton';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexCancel extends LightningElement {
    @api recordId;
    status;
@@ -37,6 +39,9 @@
    connectedCallback(){
        console.log(this.recordId);
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result => {
force-app/main/default/lwc/lexCancelReport/lexCancelReport.css
@@ -1,4 +1,4 @@
.cancelReportHolder{
/* .cancelReportHolder{
    position: relative;
    display: inline-block;
    width: 80px;
@@ -7,4 +7,4 @@
}
.container .uiContainerManager{
    display: none !important;
}
} */
force-app/main/default/lwc/lexCancelReport/lexCancelReport.html
@@ -1,6 +1,13 @@
<!--
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-09-09 13:27:59
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-21 17:59:08
-->
<template>
    <div class="cancelReportHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
    </div>
</template>
force-app/main/default/lwc/lexCancelReport/lexCancelReport.js
@@ -8,6 +8,8 @@
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import ConSent from '@salesforce/apex/BidAnnouncementController.ConSent';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexCancelReport extends NavigationMixin(LightningElement) {
    @api recordId;
    stageName;
@@ -41,6 +43,10 @@
        }
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
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-09-11 14:32:05
 * @LastEditTime: 2023-09-14 16:13:34
 */
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -15,6 +15,8 @@
import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexCancelSubmit extends LightningElement {
    @api recordId;//OwnerId
    ownerId;
@@ -40,6 +42,10 @@
    }
    connectedCallback () {
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        console.log(this.recordId);
        init({
            recordId: this.recordId
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-09-11 13:53:55
 * @LastEditTime: 2023-09-14 16:14:29
 */
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -12,6 +12,8 @@
import cancel  from '@salesforce/apex/ReportController.updateForCancelSubmitReportButton';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexCancelSubmitReport extends LightningElement {
    @api recordId;
    IsLoading = true;
@@ -32,6 +34,9 @@
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        console.log(this.recordId);
        this.cancelSubmit();
    }
force-app/main/default/lwc/lexChangeContractType/lexChangeContractType.css
@@ -1,4 +1,4 @@
.lexChangeContractTypeHolder{
/* .lexChangeContractTypeHolder{
    position: relative;
    display: inline-block;
    width: 80px;
@@ -7,4 +7,4 @@
}
.container .uiContainerManager{
    display: none !important;
}
} */
force-app/main/default/lwc/lexChangeContractType/lexChangeContractType.html
@@ -1,7 +1,15 @@
<!--
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-09-09 13:27:59
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-23 12:23:54
-->
<template>
    <div class="lexChangeContractTypeHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
        <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button>
        <!-- <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
        <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button> -->
    </div>
</template>
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-09-11 15:53:23
 * @LastEditTime: 2023-09-25 10:17:42
 */
/*
 * @Description: 
@@ -23,6 +23,8 @@
import changeTrade from '@salesforce/apex/OpportunityLightingButtonController.changeTrade';
import LightningConfirm from 'lightning/confirm';
import { NavigationMixin } from 'lightning/navigation';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexChangeContractType extends NavigationMixin(LightningElement) {
    @api recordId;
    stageName;
@@ -56,24 +58,25 @@
            try {
                console.log("22222");
                changeTrade({
                    oppId: oppId
                    oppId: this.recordId
                }).then(result=>{
                    console.log("1111");
                    str = result;
                    var str = result;
                    if(str != '1'){
                        this.showToast(str,"error");
                    }
                    this.IsLoading = false;
                    window.location = '/' + this.recordId;
                    this.dispatchEvent(new CloseActionScreenEvent());
                    this[NavigationMixin.Navigate]({
                        type: 'standard__recordPage',
                        attributes: {
                            recordId: this.recordId,
                            objectApiName: 'Opportunity',
                            actionName: 'view'
                        }
                    });
                    // window.location.href = '/lightning/r/Opportunity/' + this.recordId + '/view';
                    // this[NavigationMixin.Navigate]({
                    //     type: 'standard__recordPage',
                    //     attributes: {
                    //         recordId: this.recordId,
                    //         objectApiName: 'Opportunity',
                    //         actionName: 'view'
                    //     }
                    // });
                }).catch(error=>{
                    console.log("error");
                    console.log(error);
@@ -87,6 +90,10 @@
        }
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
@@ -101,8 +108,6 @@
        });
    }
    changeContractType(){
        var oppId = this.recordId;
        var str ;
        var status = this.stageName;
        var quostatus = this.estimationDecision;
        var win = this.sapSendOK;
force-app/main/default/lwc/lexCopyWithAsset/lexCopyWithAsset.html
@@ -4,11 +4,11 @@
 * @Author: chen jing wu
 * @Date: 2023-04-21 14:32:09
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-04-21 14:32:48
 * @LastEditTime: 2023-09-23 12:24:10
-->
<template>
    <div class="lexCopyWithAssetHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
    </div>
</template>
force-app/main/default/lwc/lexCopyWithAsset/lexCopyWithAsset.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-04-21 14:32:09
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-12 11:39:47
 * @LastEditTime: 2023-09-25 10:40:25
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -14,6 +14,8 @@
import initCopy from '@salesforce/apex/OpportunityLightingButtonController.initCopy';
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexCopyWithAsset extends NavigationMixin(LightningElement) {
    @api recordId;
    sapSendOK;
@@ -44,6 +46,10 @@
        this.dispatchEvent(event);
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
@@ -78,7 +84,8 @@
                     + ',NotesApprovedNo__c='
                     + ',Assistant_Applied_Date__c='
                     + ',Contract_DB_SalesDept_complite_day__c='
                     + ',Closing_Bid_Date__c=';
                     + ',Closing_Bid_Date__c='
                     + 'Opportunity_No__c=';
                    console.log(result);
                    this[NavigationMixin.Navigate]({
                        type: 'standard__objectPage',
force-app/main/default/lwc/lexCreateActivity/lexCreateActivity.html
@@ -1,6 +1,6 @@
<template>
    <div class="lexCreateActivityHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
    </div>
</template>
force-app/main/default/lwc/lexCreateActivity/lexCreateActivity.js
@@ -4,13 +4,15 @@
 * @Author: chen jing wu
 * @Date: 2023-05-15 09:50:42
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-05-15 10:34:33
 * @LastEditTime: 2023-09-14 16:29:45
 */
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.initForCreateActivityButton';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexCreateActivity extends LightningElement {
    @api recordId;
    accountId;
force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.html
@@ -1,6 +1,14 @@
<!--
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-09-09 13:27:59
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-23 12:24:41
-->
<template>
    <div class="lexCreateEventReportHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
        <!-- <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> -->
    </div>
</template>
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-09-11 13:53:31
 * @LastEditTime: 2023-09-14 16:31:46
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -12,6 +12,11 @@
import updateForDispatchOCSMQARAButton  from '@salesforce/apex/ReportController.updateForDispatchOCSMQARAButton';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
Promise.all([
    loadStyle(this, lwcCSS)
   ]);
export default class LexDispatchOCSMQARA extends LightningElement {
    @api recordId;
    IsLoading = true;
force-app/main/default/lwc/lexEditCancelReport/lexEditCancelReport.js
@@ -1,3 +1,11 @@
/*
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-09-11 10:34:37
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-26 09:29:28
 */
import { LightningElement, track, wire, api } from 'lwc';
import {CurrentPageReference} from 'lightning/navigation';
import { CloseActionScreenEvent } from 'lightning/actions';
@@ -42,6 +50,9 @@
            attributes: {
                recordId: this.recordId,
                actionName: 'edit'
            },
            state: {
                nooverride: '1'
            }
        });
    }
force-app/main/default/lwc/lexEditLost/lexEditLost.js
@@ -1,3 +1,11 @@
/*
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-09-12 17:37:34
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-10-02 15:35:06
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
@@ -6,10 +14,13 @@
import init  from '@salesforce/apex/OpportunityLightingButtonController.queryForEditLostButton';
import queryForProfileId  from '@salesforce/apex/OpportunityLightingButtonController.queryForProfileId';
import PCLReportProfileId from '@salesforce/label/c.PCLReportProfileId';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexEditLost extends LightningElement {
    @api recordId;
    lostlist;
    AprofileId;
    profileId;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
            console.log(111);
@@ -25,45 +36,66 @@
          }
        }
    }
    showToast(msg,type) {
        const event = new ShowToastEvent({
            title: ' ',
            message: msg,
            variant: type,
            mode: 'sticky'
        });
        this.dispatchEvent(event);
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
            this.lostlist = result;
            queryForProfileId().then()
            this.AprofileId = PCLReportProfileId.includes(this.profileId);
            this.editLost();
            queryForProfileId().then(res=>{
                this.profileId = res;
                this.AprofileId = PCLReportProfileId.includes(this.profileId);
                console.log(PCLReportProfileId);
                console.log(this.profileId);
                this.editLost();
            });
        });
    }
    editLost(){
        if (this.lostlist.size < 0){
            alert('请先创建失单报告');
            return;
         }else if(this.lostlist.size > 1){
        console.log(this.lostlist.length);
        if (this.lostlist.length <= 0){
            // alert('请先创建失单报告');
            this.showToast('请先创建失单报告','error');
            this.dispatchEvent(new CloseActionScreenEvent());
         }else if(this.lostlist.length > 1){
            //alert('1');
            for(var lost of lostlist ){
            for(var lost of this.lostlist ){
                //alert('3');
                //alert(lost.RecordTypeId);
                if(lost.RecordTypeId == '01210000000R4hMAAS'){
                    //alert('4');
                    if(lost.Report_Status__c == '草案' || profileId == '00e10000000Y3o5' || (lost.Report_Status__c == '批准' && AprofileId)){
                    if(lost.Report_Status__c == '草案' || this.profileId == '00e10000000Y3o5' || (lost.Report_Status__c == '批准' && AprofileId)){
                        //alert('5');
                        window.open("/apex/PCLLostReportPageLwc?pageStatus=Edit&Id="+lost.Id);
                        window.open("/apex/PCLLostReportPageLwc?pageStatus=Edit&reportId="+lost.Id);
                    }else{
                        window.open("/apex/PCLLostReportPageLwc?pageStatus=View&Id="+lost.Id);
                        window.open("/apex/PCLLostReportPageLwc?pageStatus=View&reportId="+lost.Id);
                    }
                }
            }
            this.dispatchEvent(new CloseActionScreenEvent());
            }
            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);
                if(this.lostlist[0].Report_Status__c == '草案' || this.profileId == '00e10000000Y3o5' || (this.lostlist[0].Report_Status__c == '批准' && AprofileId)){
                    window.open("/apex/PCLLostReportPageLwc?pageStatus=Edit&reportId="+this.lostlist[0].Id);
                }else{
                    window.open("/apex/PCLLostReportPageLwc?pageStatus=View&Id="+lostlist[0].Id);
                    window.open("/apex/PCLLostReportPageLwc?pageStatus=View&reportId="+this.lostlist[0].Id);
                }
                this.dispatchEvent(new CloseActionScreenEvent());
            }
    }
}
force-app/main/default/lwc/lexEnquiryNoBidding/lexEnquiryNoBidding.html
@@ -1,6 +1,14 @@
<!--
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-09-09 13:27:59
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-23 12:24:56
-->
<template>
    <div class="lexCreateEventReportHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
    </div>
</template>
force-app/main/default/lwc/lexImprovedForecastTimeNew/__tests__/lexImprovedForecastTimeNew.test.js
New file
@@ -0,0 +1,25 @@
import { createElement } from 'lwc';
import LexImprovedForecastTimeNew from 'c/lexImprovedForecastTimeNew';
describe('c-lex-improved-forecast-time-new', () => {
    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-improved-forecast-time-new', {
            is: LexImprovedForecastTimeNew
        });
        // Act
        document.body.appendChild(element);
        // Assert
        // const div = element.shadowRoot.querySelector('div');
        expect(1).toBe(1);
    });
});
force-app/main/default/lwc/lexImprovedForecastTimeNew/lexImprovedForecastTimeNew.html
New file
@@ -0,0 +1,135 @@
<template>
    <div class="exampleHolder" if:true={IsLoading} >
        <lightning-spinner alternative-text="Loading" size="large"></lightning-spinner>
      </div>
      <div style="padding:30px">
        <template if:true={visible}>
            <template if:true={isSuccess}>
                <div class="slds-notify_container slds-is-relative" style="position:absolute;top:1rem;left:1rem;right:1rem;position: fixed;z-index: 9999;">
                    <div class="slds-notify slds-notify_toast slds-theme_success" role="status">
                        <lightning-icon class="white" icon-name="utility:success" alternative-text="success"  variant="inverse" size="small" ></lightning-icon>
                      <div class="slds-notify__content"  style="padding-left: 20px;">
                        <h2 style="color:white;font-size:large">{message}</h2>
                      </div>
                      <div class="slds-notify__close">
                        <lightning-button-icon icon-name="utility:close"  variant="bare-inverse" size="large" onclick={closeAction}></lightning-button-icon>
                      </div>
                    </div>
                  </div>
                <!-- <div style="position:absolute;top:1rem;left:1rem;right:1rem;position: fixed;z-index: 9999;">
                    <div class="slds-notify_container slds-is-relative">
                        <div class="slds-notify slds-notify_toast slds-theme_default slds-box slds-box_small"  style="background-color:rgb(46, 132, 74);" role="success">
                        <div class="slds-align_absolute-center">
                        </div>
                        </div>
                    </div>
                </div> -->
            </template>
            <template if:false={isSuccess}>
                <!-- <div style="position:absolute;top:1rem;left:1rem;right:1rem;position: fixed;z-index: 9999;">
                    <div class="slds-notify_container slds-is-relative">
                        <div class="slds-notify slds-notify_toast slds-theme_default slds-box slds-box_small"  style="background-color:rgb(234, 0, 30);" role="success">
                        <div class="slds-align_right">
                        </div>
                        </div>
                    </div>
                </div> -->
                <div class="slds-notify_container slds-is-relative" style="position:absolute;top:1rem;left:1rem;right:1rem;position: fixed;z-index: 9999;">
                    <div class="slds-notify slds-notify_toast slds-theme_error" role="status">
                        <lightning-icon class="white" icon-name="utility:error"  size="small" variant="inverse"></lightning-icon>
                      <div class="slds-notify__content" style="padding-left: 20px;">
                        <h2 style="color:white;font-size:large">{message}</h2>
                      </div>
                      <div class="slds-notify__close">
                        <lightning-button-icon icon-name="utility:close" variant="bare-inverse" size="large" onclick={closeAction}></lightning-button-icon>
                      </div>
                    </div>
                  </div>
            </template>
        </template>
        <p><lightning-formatted-text value="当前预测OCSM签约日 : " ></lightning-formatted-text>{opp.Close_Forecasted_Check}</p>
        <div class={xgxLy} style="width: 495px;padding:1px">
            <lightning-combobox
              name="progress"
              label="日期提前/日期延后"
              value={opp.Date_InAdvance_Delay}
              options={RelateOption}
              onchange={handleRelationFn} >
            </lightning-combobox>
        </div>
        <!-- 提前 -->
        <div class={bxgLy} if:true={isAdvance}>
            <lightning-combobox
              name="progress"
              label="预测日期提前理由"
              value={opp.Predicted_date_ChangeReason}
              placeholder="请选择提前理由"
              options={AdvanceReasons}
              style="width: 495px;padding:1px"
              onchange={handleRelationFn1}
              >
            </lightning-combobox>
            <div style="font-size:10px;color:red" if:true={bxgLyFlag}>请选择提前理由</div>
        </div>
        <!-- 延后 -->
        <!-- onchange={handleIrrelevantFn} -->
        <div class={bxgLy} if:true={isDelay}>
            <lightning-combobox
              name="progress"
              label="预测日期延后理由"
              value={opp.Predicted_date_ChangeReason}
              placeholder="请选择延后理由"
              options={DelayReasons}
              style="width: 495px;padding:1px"
              onchange={handleRelationFn1}
            >
            </lightning-combobox>
            <div style="font-size:10px;color:red" if:true={bxgLyFlag}>请选择延后理由</div>
        </div>
        <!-- 改变日期 -->
        <div>
          <lightning-input
            class="custom-date-input"
            type="date"
            label="请选择要改变的日期"
            name="aaa"
            style="width: 495px;padding:1px"
            value={opp.Close_Forecasted_Date}
            onchange={handleRelationFn2}
          >
        </lightning-input>
        </div>
        <div if:true={flg}>
          <lightning-input
            class="custom-date-input1"
            type="date"
            label="预测发货日"
            name="aa"
            style="width: 495px;padding:1px"
            value={opp.CloseDate}
            onchange={handleRelationFn3}
          >
        </lightning-input>
        </div>
        <button
          class="slds-button slds-button_brand"
          onclick={saveFn}
          style="margin-top: 10px"
        >
        保存
        </button>
      </div>
</template>
force-app/main/default/lwc/lexImprovedForecastTimeNew/lexImprovedForecastTimeNew.js
New file
@@ -0,0 +1,290 @@
import { api, wire,LightningElement } from 'lwc';
import GetOppinformationcData from '@salesforce/apex/ImprovedForecastTimeController.GetOppinformationcData';
import getReason from '@salesforce/apex/ImprovedForecastTimeController.getReason';
import SaveData from '@salesforce/apex/ImprovedForecastTimeController.SaveData';
import SystemModstamp from '@salesforce/schema/Account.SystemModstamp';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { CloseActionScreenEvent } from 'lightning/actions';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
import lexDateCss1 from '@salesforce/resourceUrl/lexDateCss1';
export default class LexImprovedForecastTimeNew extends LightningElement {
    @api recordId;
    //显示与隐藏
    isAdvance = false;  //选着 提前 的标识
    isDelay = false; //选着 延后 的标识
    isSuccess = false;
    message;
    visible;
    RelateOption=[
        {label:"提前",value:"提前"},
        {label:"延后",value:"延后"},
    ]
    closeAction(){
        this.visible = false;
    }
    handleRelationFn(event){
        var value = event.target.value;
        this.opp.Date_InAdvance_Delay = value;
debugger
        // this.opp.Predicted_date_ChangeReason__c = '';
        //SWAG-CJR4PC【委托】调查-修改预测日提前理由错误 fy start
        this.opp.Predicted_date_ChangeReason = ''
        this.opp.Close_Forecasted_Date= '';
        this.opp.CloseDate= '';
        //SWAG-CJR4PC【委托】调查-修改预测日提前理由错误 fy end
        if (value == "提前") {
            this.isAdvance = true;
            this.isDelay = false;
        }
        if (value == "延后") {
            this.isAdvance = false;
            this.isDelay = true;
        }
    }
    handleRelationFn1(event){
        var value = event.target.value;
        this.opp.Predicted_date_ChangeReason = value;
    }
    flg=true;
    handleRelationFn2(event){
        var value = event.target.value;
        this.opp.Close_Forecasted_Date = value;
        this.flg=false;
        debugger
        this.CloseDateAssignment(value);
    }
    //给预测发货日赋值
    CloseDateAssignment(value){
        debugger
        var value=this.addDay(30,value);
        this.opp.CloseDate = value;
        this.flg=true;
    }
    //加天数
    addDay(dayNumber, value1) {
        var date = new Date(value1);
        var ms = dayNumber * (1000 * 60 * 60 * 24)
        var newDate = new Date(date.getTime() + ms);
        var value=newDate.toLocaleDateString();
        var value2=value.split('/');
        if(value2[1].length == 1){
            value2[1]='0'+value2[1];
        }
        if(value2[2].length == 1){
            value2[2]='0'+value2[2];
        }
        value=value2[0]+'-'+value2[1]+'-'+value2[2];
        return value;
    }
    handleRelationFn3(event){
        var value = event.target.value;
        this.opp.CloseDate = value;
    }
    //从url上取得ID
    getQueryVariable(variable)
    {
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        for (var i=0;i<vars.length;i++) {
                var pair = vars[i].split("=");
                if(pair[0] == variable){return pair[1];}
        }
        return(false);
    }
    oppId = '';
    opp = {};
    Date_InAdvance_Delay = '';
    AdvanceReasons = [];
    DelayReasons = [];
    //初始化
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS),
            loadStyle(this, lexDateCss1)
           ]);
        this.oppId = this.recordId;
        console.log('oppId--' + this.oppId);
        GetOppinformationcData({ParamIdStr:this.oppId}).then(response=>{
            this.opp=JSON.parse(response);
            if(this.opp.Date_InAdvance_Delay == '提前'){
                this.isAdvance = true;
                this.isDelay = false;
            }
            if(this.opp.Date_InAdvance_Delay == '延后'){
                this.isAdvance = false;
                this.isDelay = true;
            }
        });
        getReason().then(response=>{
            var options = JSON.parse(response);
            this.AdvanceReasons = options['提前'];
            this.DelayReasons = options['延后'];
        });
    }
    //提示
    SaveShowText="保存成功";//提示框的文本
    Tongzhishow=false;  //提示显示的标识
    TongzhiIcon = 'standard:account' //提示框的图标
    IsLeftStyle = "" //提示框的样式
    BgColorStyle = ""
    //弹框提示 content 内容 error 是否是错误提示框  left 是否居左
    Alert(content,error = false,left = false){
        this.SaveShowText = content;
        this.Tongzhishow = true;
        if (error) {
            this.TongzhiIcon = "standard:first_non_empty";
            this.BgColorStyle = "background-color:#ba0517";
        }else{
            this.TongzhiIcon = "standard:account";
            this.BgColorStyle = "background-color:#DD7A01";
        }
        if (left) {
            this.IsLeftStyle = "left: 0.25rem"
        }else{
            this.IsLeftStyle = ""
        }
    }
    showToast(msg,type) {
        try {
            if(type == 'success'){
                this.isSuccess = true;
            }else{
                this.isSuccess = false;
            }
            this.message = msg;
            this.visible = true;
            let delay = 5000;
            console.log(this.message);
            console.log('1');
            // setTimeout(() => {
            //     this.visible = false;
            // }, delay );
        } catch (error) {
            console.log(error);
        }
    }
    //关闭提示框
    CloseAlert(){
        this.closeOffRefresh();
    }
    closeOffRefresh(){
        if (this.Tongzhishow == true) {
            this.Tongzhishow = false;
        }
        if (this.SaveShowText != "") {
            this.SaveShowText = "";
        }
    }
    //加载
    IsLoading = false;
    OnLoading(flag) {
        this.IsLoading = flag;
    }
    //保存数据逻辑
    saveFn(){
        debugger
        var myDate = new Date();                                        //今天日期
        var myDate1 = new Date(this.opp.Close_Forecasted_Check);        //当前预测日期
        var myDate2 = new Date(this.opp.Close_Forecasted_Date);  //改变的预测日期
        var myDate3 = new Date(myDate.toLocaleDateString());            //今天日期          格式化
        var myDate4 = new Date(myDate1.toLocaleDateString());           //当前预测日期      格式化
        var myDate5 = new Date(myDate2.toLocaleDateString());           //改变的预测日期    格式化
        var myDate6 = new Date(this.opp.CloseDate);
        var myDate7 = new Date(myDate6.toLocaleDateString());    //发货日期
        //20221226 lt DB202212359066增加限制-修改预测日最大日期 start
        var date1 = new Date();
        var year = date1.getFullYear();
        var month = date1.getMonth() + 1;
        if(month > 3){
            year = year + 1;
        }
        var strDate = "-03-31";
        var Odate = year + 3;
        var Sdate = year + 4;
        var Odate1 = Odate + strDate;
        var Sdate1 = Sdate + strDate;
        var Odate2 = new Date(Odate1);
        var Sdate2 = new Date(Sdate1);
        // //订货预测日
        var OrderDate = new Date(Odate2.toLocaleDateString());
        // //发货预测日
        var ShipmentsDate = new Date(Sdate2.toLocaleDateString());
        //20221226 lt DB202212359066增加限制-修改预测日最大日期 end
        console.warn('myDatevalue:='+myDate);
        console.warn('今天日期'+myDate3);
        console.warn('当前预测日期'+myDate4);
        console.warn('1111111111'+myDate2);
        console.warn('改变的预测日期'+myDate5);
        //SWAG-CJR4PC【委托】调查-修改预测日提前理由错误 fy start
        // if(this.opp.Date_InAdvance_Delay == undefined || this.opp.Predicted_date_ChangeReason == undefined || myDate5 == undefined){
        // if(this.opp.Date_InAdvance_Delay == '' ||this.opp.Date_InAdvance_Delay == undefined || this.opp.Predicted_date_ChangeReason == '' ||this.opp.Predicted_date_ChangeReason == undefined|| myDate5 == '' || myDate5 == undefined){
        if(!this.opp.Date_InAdvance_Delay || !this.opp.Predicted_date_ChangeReason ||  !this.opp.Close_Forecasted_Date){
        //SWAG-CJR4PC【委托】调查-修改预测日提前理由错误 fy end
            this.showToast("请选择日期/理由。","error");
        }
        else if(this.opp.Date_InAdvance_Delay == '提前' && (myDate5 >= myDate4 || myDate5 < myDate3)){
            this.showToast("请选择 “提前” 于当前预测OCSM签约日的日期 且 不早于今天。","error");
        }
        else if(this.opp.Date_InAdvance_Delay == '延后' && myDate5 <= myDate4){
            this.showToast("请选择 “延后” 于当前预测OCSM签约日的日期。","error");
        }
        else if(myDate7 < myDate5){
            this.showToast("预测发货日不能小于预测签约日。","error");
        }
        //20221226 lt DB202212359066增加限制-修改预测日最大日期 start
        else if(myDate5 > OrderDate){
            this.showToast("订货预测日请在未来三财年内。","error");
        }
        else if(myDate7 > ShipmentsDate){
            this.showToast("发货预测日请在未来四财年内。","error");
        }
        //20221226 lt DB202212359066增加限制-修改预测日最大日期 end
        else{
            this.OnLoading(true);
            SaveData({JsonData:JSON.stringify(this.opp)}).then((response)=>{
                if (response == '成功') {
                    this.OnLoading(false);
                    this.showToast("保存成功","success");
                    // window.location.hash = "Refresh"+"=="+this.oppId;
                    const closeEvent = new CustomEvent('closeaction', {
                        bubbles: true, // 允许事件冒泡至父组件
                        composed: true, // 允许事件穿越 Shadow DOM 界限
                    });
                    setTimeout(() => {
                        window.close();
                    }, 2000);
                    this.dispatchEvent(closeEvent);
                }else{
                    this.showToast(response,"error");
                }
            });
        }
    }
}
force-app/main/default/lwc/lexImprovedForecastTimeNew/lexImprovedForecastTimeNew.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/lexLookupLwc/lexLookupLwc.html
@@ -4,10 +4,10 @@
 * @Author: chen jing wu
 * @Date: 2023-05-25 13:59:44
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-08-02 14:28:20
 * @LastEditTime: 2023-09-27 15:30:16
-->
<template>
    <div>
    <div data-id="myInput">
        <div class="slds-form-element">
           <div class="slds-form-element__control">
              <div class="slds-combobox_container">
@@ -15,14 +15,18 @@
                    <div class="slds-combobox__form-element slds-input-has-icon slds-input-has-icon_right" role="none">
                       <template if:false={recordselected}>
                          <input class="slds-input slds-combobox__input" id="combobox-id-1" aria-autocomplete="list" aria-controls="listbox-id-1"
                             role="textbox" type="text" placeholder="Search..." style="width: 190px;"  onkeyup={onKeyChange} value={selectedValue}/ disabled={disabled} onclick={onKeyChange}>
                             role="textbox" type="text" placeholder="Search..."   onkeyup={onKeyChange} value={selectedValue}/ disabled={disabled} onclick={onKeyChange} onblur={clear}>
                       </template>
                       <template if:true={recordselected}>
                          <span class="slds-pill slds-pill_link fullWidth slds-input slds-combobox__input"> 
                             <a href="javascript:void(0);"
                                class="slds-pill__action slds-p-left_x-small" title={selectedValue} style="height: 32px;">
                                <lightning-icon icon-name={iconname} size="x-small"></lightning-icon>
                                <span class="slds-pill__label slds-p-left_x-small" style="display: inline-flex;width: 150px">{selectedValue}</span>
                                <div style="width: 80%;">
                                 <lightning-icon icon-name={iconname} size="x-small"></lightning-icon>
                                <span class="slds-pill__label slds-p-left_x-small" style="display: inline-flex;max-width:185px">{selectedValue}</span>
                                </div>
                             </a>
                             <button onclick={clearSelection}
                             class="slds-button slds-button_icon slds-button_icon slds-pill__remove" 
@@ -36,12 +40,12 @@
                    </div>
                    <template if:true={recordsList}>
                       <div class="slds-combobox_container">
                          <div id="listbox-id-1" class="slds-dropdown slds-dropdown_fluid slds-dropdown_autocomplete" role="listbox" style="min-width: 350px; overflow: auto;">
                          <div id="listbox-id-1" class="slds-dropdown slds-dropdown_fluid slds-dropdown_autocomplete" role="listbox" style=" overflow: auto;">
                             <ul class="slds-listbox slds-listbox_vertical" role="presentation">
                                <template for:each={recordsList} for:item="item">
                                   <li key={item.Id} role="presentation" class="slds-listbox__item">
                                      <div class="slds-media slds-listbox__option slds-listbox__option_plain slds-media_small" role="option"
                                         data-itemid = {item.Id} data-itemname={item.Name} onclick={setSelectedValue}>
                                         data-itemid = {item.Id} data-itemname={item.Name} onmousedown={setSelectedValue}>
                                         <span role="menuitem" tabindex="-1" data-itemid = {item.Id} data-itemname={item.Name}>
                                            <lightning-icon icon-name={iconname} size="x-small" data-itemid = {item.Id} data-itemname={item.Name}></lightning-icon> {item.Name}
                                         </span>
force-app/main/default/lwc/lexLookupLwc/lexLookupLwc.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-05-25 13:59:44
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-08-16 13:59:32
 * @LastEditTime: 2023-09-27 15:30:05
 */
import { LightningElement, track, api } from 'lwc';
import getRecordsByName from '@salesforce/apex/lexLookupController.getRecordsByName'
@@ -43,11 +43,14 @@
        
    }
    connectedCallback(){
        if(this.initValue != '' && this.initValue != undefined && this.initValue != null){
            this.recordselected = true;
            this.selectedValue = this.initValue;
        }
    }
    @api
    letDisabledTrue(){
        this.recordselected = false;
@@ -65,6 +68,7 @@
    //Method to clear search list and show selected value.
    @api
    clearSelection() {
        console.log('qwer');
        this.recordselected = false;
        this.selectedValue = "";
        this.recordsList = undefined;
@@ -90,4 +94,7 @@
        });
        this.dispatchEvent(selectedEvent);
    }
    clear(){
        this.recordsList = undefined;
    }
}
force-app/main/default/lwc/lexLoseBid/lexLoseBid.css
@@ -4,9 +4,9 @@
 * @Author: chen jing wu
 * @Date: 2023-04-13 10:31:18
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-04-13 10:46:09
 * @LastEditTime: 2023-09-20 17:10:12
 */
.lexLoseBidHolder{
/* .lexLoseBidHolder{
    position: relative;
    display: inline-block;
    width: 80px;
@@ -15,4 +15,4 @@
}
.container .uiContainerManager{
    display: none !important;
}
} */
force-app/main/default/lwc/lexLoseBid/lexLoseBid.html
@@ -1,7 +1,5 @@
<template>
    <div class="lexLoseBidHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
        <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button>
    </div>
</template>
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-09-11 16:46:08
 * @LastEditTime: 2023-09-20 17:11:07
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -15,10 +15,12 @@
import updateForLoseBidButton  from '@salesforce/apex/OpportunityLightingButtonController.updateForLoseBidButton';
import queryForLexLoseBidButton  from '@salesforce/apex/OpportunityLightingButtonController.queryForLoseBidButton';
import LightningConfirm from 'lightning/confirm';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexLoseBid extends LightningElement {
    @api recordId;
    ifOpenBid;
    IsLoading = true;
    IsLoading;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
            console.log(111);
@@ -40,6 +42,7 @@
            variant: 'headerless',
            label: 'this is the aria-label value',
        });
        this.IsLoading = true;
        console.log(result);
        if(result){
            try {
@@ -63,6 +66,9 @@
        }
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
force-app/main/default/lwc/lexLoseReport/lexLoseReport.css
@@ -1,10 +1,10 @@
.lexLoseReportHolder{
/* .lexLoseReportHolder{
    position: relative;
    display: inline-block;
    width: 80px;
    height: 80px;
    width: 40px;
    height: 40px;
    text-align: center;
}
.container .uiContainerManager{
    display: none !important;
}
} */
force-app/main/default/lwc/lexLoseReport/lexLoseReport.html
@@ -1,6 +1,13 @@
<!--
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-09-09 13:27:59
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-22 14:21:54
-->
<template>
    <div class="lexLoseReportHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
    </div>
</template>
force-app/main/default/lwc/lexLoseReport/lexLoseReport.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-04-20 14:08:55
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-08-25 16:44:13
 * @LastEditTime: 2023-09-25 13:21:17
 */
/*
 * @Description: 
@@ -20,6 +20,8 @@
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import init  from '@salesforce/apex/OpportunityLightingButtonController.initForLostReportButton';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexLoseReport extends LightningElement {
    @api recordId;
    stageName;
@@ -32,6 +34,7 @@
    salesManagerDepartmentID;
    salesOwnerBuchang;
    salesOwnerBuchangID;
    cntLostCancelDraft;
    IsLoading = true;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
@@ -49,6 +52,10 @@
        }
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
@@ -62,6 +69,7 @@
            this.salesManagerDepartmentID = result.salesManagerDepartmentID;
            this.salesOwnerBuchang = result.salesOwnerBuchang;
            this.salesOwnerBuchangID = result.salesOwnerBuchangID;
            this.cntLostCancelDraft = result.cntLostCancelDraft;
            this.loseReport();
        })
    }
@@ -75,8 +83,9 @@
        else if (this.sapSendOK == '1') {
            this.showToast("已经上传SAP、不能做 失单 了!","error");
        }
        else if (this.cntLostCancelReport > 0) {
            this.showToast("询价已经有 取消/失单报告 了!","error");
        else if (this.cntLostCancelReport - this.cntLostCancelDraft > 0) {
            // this.showToast("询价已经有 取消/失单报告 了!","error");
            this.showToast('询价已经有 取消/失单报告 了!','error');
        }
        //else if({!Not(ISBLANK(Opportunity.Bidding_Project_Name_Bid__c))} && //'{!Opportunity.InfoTypeBid__c}' != '3:结果' ){
        //alert("关联招投标项目的询价,只能在有结果后做失单报告!");
@@ -103,10 +112,37 @@
            title: ' ',
            message: msg,
            variant: type,
            mode: 'sticky'
            duration: 15000
        });
        this.dispatchEvent(event);
    }
    //显示信息
    showMyToast(title, message, variant) {
        console.log('show custom message');
        let iconName = '';
        let content = '';
        if (variant == 'success') {
            iconName = 'utility:check';
        } else {
            iconName = 'utility:error';
        }
        if (message != '') {
            content =
                '<h2><strong>' +
                title +
                '<strong/></h2><h5>' +
                message +
                '</h5>';
        } else {
            content = '<h2><strong>' + title + '<strong/></h2>';
        }
        this.template
            .querySelector('c-common-toast')
            .showToast(variant, content, iconName, 10000).then(result=>{
                this.dispatchEvent(new CloseActionScreenEvent());
            });
        this.isLoading = false;
    }
    updateRecordView(recordId) {
        updateRecord({fields: { Id: recordId }});
    }
force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.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-14 16:33:54
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
@@ -5,7 +13,8 @@
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexNewAgencyHospital extends NavigationMixin(LightningElement) {
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
@@ -36,6 +45,9 @@
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        var doubleFlg = false;
        if(!doubleFlg) {
        doubleFlg = true;
force-app/main/default/lwc/lexNewOpportunityAgency/lexNewOpportunityAgency.css
@@ -1,4 +1,4 @@
.lexNewOpportunityAgencyHolder{
/* .lexNewOpportunityAgencyHolder{
    position: relative;
    display: inline-block;
    width: 80px;
@@ -7,4 +7,4 @@
}
.container .uiContainerManager{
    display: none !important;
}
} */
force-app/main/default/lwc/lexNewOpportunityAgency/lexNewOpportunityAgency.html
@@ -1,6 +1,14 @@
<!--
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-09-09 13:27:59
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-23 12:27:19
-->
<template>
    <div class="lexNewOpportunityAgencyHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
    </div>
</template>
force-app/main/default/lwc/lexNewOpportunityAgency/lexNewOpportunityAgency.js
@@ -9,6 +9,9 @@
import queryForRecords2 from '@salesforce/apex/OpportunityLightingButtonController.queryForNewOpportunityAgencyButtonToRecords2';
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexNewOpportunityAgency extends NavigationMixin(LightningElement) {
    @api recordId;
    agency1Id;
@@ -41,6 +44,10 @@
        }
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
@@ -206,8 +213,21 @@
                                            // + encodeURIComponent(this.opportunityCategory);
                                            // console.log(url);
                                            // window.open(url);
                                            if(this.closeForecastedDate){
                                                if(!this.closeForecastedDate.includes(' ')){
                                                    this.closeForecastedDate += ' 00:00:00'
                                                }
                                                this.closeForecastedDate = this.closeForecastedDate.replace(' ','T').replaceAll('/','-') + '.000Z';
                                                console.log(this.closeForecastedDate);
                                            }
                                            if(this.bidPlannedDate){
                                                if(!this.bidPlannedDate.includes(' ')){
                                                    this.bidPlannedDate += ' 00:00:00'
                                                }
                                                this.bidPlannedDate = this.bidPlannedDate.replace(' ','T').replaceAll('/','-') + '.000Z';
                                            }
                                            const defaultValues = encodeDefaultFieldValues({
                                                Name: '(OLYMPUS)',
                                                Name: '(OLYMPUS)' + this.name,
                                                Close_Forecasted_Date__c: this.closeForecastedDate,
                                                Bid_Planned_Date__c: this.bidPlannedDate,
                                                OCM_Change_To_Opportunity_Flg__c: '1',
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-09-11 15:35:43
 * @LastEditTime: 2023-09-14 16:35:40
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -14,6 +14,8 @@
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import init from '@salesforce/apex/OpportunityLightingButtonController.initForNewOpportunityFileButton';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexNewOpportunityFile extends NavigationMixin(LightningElement) {
    @api recordId;
    stockApplyStatus;
@@ -42,6 +44,9 @@
        this.dispatchEvent(event);
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
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-09-11 15:32:14
 * @LastEditTime: 2023-09-14 16:36:05
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -15,7 +15,8 @@
import LightningConfirm from 'lightning/confirm';
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexNewSolutionClosingAttachment extends NavigationMixin(LightningElement) {
    @api recordId;
    schemeType;
@@ -44,6 +45,9 @@
        this.dispatchEvent(event);
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
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-09-11 15:23:16
 * @LastEditTime: 2023-09-14 16:36:31
 */
import { api, wire,LightningElement } from 'lwc';
@@ -16,7 +16,8 @@
import LightningConfirm from 'lightning/confirm';
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexNewSolutionProgramma extends NavigationMixin(LightningElement) {
  @api recordId;
  status;
@@ -49,6 +50,10 @@
    this.dispatchEvent(event);
}
  connectedCallback(){
    Promise.all([
      loadStyle(this, lwcCSS)
     ]);
    init({
      recordId: this.recordId
    }).then(result=>{
force-app/main/default/lwc/lexNewSolutonProLwc/lexNewSolutonProLwc.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-08-24 15:52:32
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-08-24 15:54:14
 * @LastEditTime: 2023-09-14 16:36:52
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -21,7 +21,8 @@
import SolutionXNLabel from '@salesforce/label/c.Solution_XN';
import SolutionHDLabel from '@salesforce/label/c.Solution_HD';
import SolutionHNLabel from '@salesforce/label/c.Solution_HN';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexNewSolutonProLwc extends NavigationMixin(LightningElement) {
    @api accountId;
    hospitalSalesdepartmentHP;
@@ -44,6 +45,9 @@
        }
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.accountId
        }).then(result=>{
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-09-11 13:53:14
 * @LastEditTime: 2023-10-03 12:39:11
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -14,6 +14,8 @@
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import LightningConfirm from 'lightning/confirm';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexOCSMNoToReportForReport extends LightningElement {
    @api recordId;
    IsLoading = true;
@@ -51,7 +53,7 @@
                    this.dispatchEvent(new CloseActionScreenEvent());
                    return;
                }
                this.awareDate = Date.now();
                // this.awareDate = Date.now();
                if(this.awareDate != undefined ){
                   updateForOCSMNoToReportButton({
                        recordId: this.recordId
@@ -83,6 +85,9 @@
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        console.log("123");
        init({
            recordId: this.recordId
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-09-11 13:53:04
 * @LastEditTime: 2023-09-14 16:38:02
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -14,6 +14,8 @@
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import LightningConfirm from 'lightning/confirm';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexOCSMToReport extends LightningElement {
    @api recordId;
    IsLoading = true;
@@ -73,6 +75,9 @@
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        console.log(this.recordId);
        init({
            recordId: this.recordId
force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.css
@@ -1,4 +1,4 @@
.lexOLYwinBidHolder{
/* .lexOLYwinBidHolder{
    position: relative;
    display: inline-block;
    width: 80px;
@@ -7,4 +7,9 @@
}
.container .uiContainerManager{
    display: none !important;
} */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
}
force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.html
@@ -1,7 +1,13 @@
<!--
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-09-09 13:27:59
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-20 17:04:39
-->
<template>
    <div class="lexOLYwinBidHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
        <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button>
        <lightning-spinner class="spinner-container" alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
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-09-11 16:53:01
 * @LastEditTime: 2023-09-20 16:58:35
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -15,10 +15,12 @@
import updateForOLYwinBidButton  from '@salesforce/apex/OpportunityLightingButtonController.updateForOLYwinBidButton';
import queryForOLYwinBidButton  from '@salesforce/apex/OpportunityLightingButtonController.queryForOLYwinBidButton';
import LightningConfirm from 'lightning/confirm';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexOLYwinBid extends LightningElement {
    @api recordId;
    ifOpenBid;
    IsLoading = true;
    IsLoading;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
            console.log(111);
@@ -40,6 +42,7 @@
            variant: 'headerless',
            label: 'this is the aria-label value',
        });
        this.IsLoading = true;
        console.log(result);
        if(result){
            try {
@@ -63,6 +66,9 @@
        }
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
force-app/main/default/lwc/lexOPDReport/lexOPDReport.js
@@ -5,7 +5,8 @@
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import init from '@salesforce/apex/ReportController.initForOPDReportButton';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexOPDReport extends NavigationMixin(LightningElement) {
    @api recordId;
    assetReturnDay2;
@@ -50,6 +51,9 @@
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
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-09-11 13:49:57
 * @LastEditTime: 2023-09-14 16:39:39
 */
import { LightningElement,api, track, wire } from 'lwc';
import {CurrentPageReference} from 'lightning/navigation';
@@ -13,7 +13,8 @@
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import init from '@salesforce/apex/ReportController.initForOPDReportConsumButton';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexOPDReportConsum extends NavigationMixin(LightningElement) {
    @api recordId;
    raStatus;
@@ -57,6 +58,9 @@
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
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-09-11 13:52:47
 * @LastEditTime: 2023-09-14 16:40:30
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -14,7 +14,8 @@
import { updateRecord } from 'lightning/uiRecordApi';
import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexOPDtoSIS extends LightningElement {
    @api recordId;
    IsLoading = true;
@@ -40,6 +41,9 @@
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        console.log(this.recordId);
        init({
            recordId: this.recordId
force-app/main/default/lwc/lexOpporSplite/lexOpporSplite.html
@@ -1,6 +1,14 @@
<!--
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-09-09 13:27:59
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-23 12:27:55
-->
<template>
    <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-09-12 14:14:04
 * @LastEditTime: 2023-09-14 16:40:55
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -15,6 +15,8 @@
import initCopy from '@salesforce/apex/OpportunityLightingButtonController.initCopy';
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexOpporSplite extends NavigationMixin(LightningElement) {
    @api recordId;
    authorizedDBNo;
@@ -39,6 +41,9 @@
        }
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.css
@@ -1,84 +1,111 @@
.combobox-container {
    display: flex;
    align-items: center;
}
@import 'c/lexCssUtility';
.combobox-container label {
    margin-right: 10px;
}
.THIS.white svg {
    fill : white;
}
/* .holder{
    position: relative;
    display: inline-block;
    width: 80px;
    height: 80px;
    text-align: center;
} */
.my-combobox {
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    width: 200px;
}
.slds-form-element__label {
    width: 144px;
    margin-right: -5rem;
}
.myinitDiv{
}
.card{
}
.my-addbutton{
    -webkit-text-size-adjust: 100%;
    font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';
    line-height: normal;
    color: rgb(3, 45, 96);
    -webkit-tap-highlight-color: transparent;
    border-spacing: 0;
    border-collapse: separate;
    font-size: 13px;
    white-space: normal;
.lexBorder[c-lexPCLLostReportPage_lexPCLLostReportPage] {
    color: #0A81DF;
    width: 88px !important;
    height: 34px;
    border-radius: 4px;
    opacity: 1;
    background: #FFFFFF;
    box-sizing: border-box;
    border: 0;
    border: 1px solid #0A81DF;
    font-size: small;
}
lightning-combobox label {
  color: black !important;
}
    .container {
    display: flex;
    justify-content: space-between; /* 设置子元素间的间距 */
    }
    .item {
    flex: 1; /* 设置子元素的伸缩比例,平分剩余空间 /
    max-width: 100%; / 防止子元素溢出容器 */
    }
label {
  color: black !important;
}
.Pop{
  height: 300px;
  width: 400px;
  background-color: white;
}
    .text-container p:first-line {
        background-color: rgb(165, 63, 63);
      }
.lexBorder1 {
    font-size: small;
    font-family: 'sans-serif';
    font-weight: 500;
    color: #0A81DF;
    width: 62px;
    height: 34px;
    border-radius: 4px;
    opacity: 1;
    background: #FFFFFF;
    box-sizing: border-box;
    border: 1px solid #0A81DF;
}
.iconButton button{
    padding-bottom: 11px;
}
table tr {
    text-align: center !important;
  }
.lexBorder3 {
    font-size: small;
    font-family: 'sans-serif';
    font-weight: 500;
    color: #0A81DF;
    width: 114px;
    height: 34px;
    border-radius: 4px;
    opacity: 1;
    background: #FFFFFF;
    box-sizing: border-box;
    border: 1px solid #0A81DF;
}
/* 自定义表头样式 */
.custom-table th {
    background-color: #F3F3F3; /* 将背景颜色更改为灰色 */
    border-right: 1px solid #AEAEAE; /* 添加右侧竖线 */
    padding: 10px; /* 添加内边距以增加可读性 */
  }
    .slds-accordion__summary-heading{
        background-color: rgb(192, 70, 70);
    }
  /* 最后一个表头单元格不添加右侧竖线 */
  .custom-table th:last-child {
    border-right: none;
  }
  lightning-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999; /* 确保在最上层显示 */
  }
  :host {
    --slds-c-accordion-summary-color-background: #F3F3F3;
    --slds-c-accordion-heading-text-color: #181818;
  }
  /* CSS 文件中的样式 */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8); /* 背景色,可以根据需要调整透明度 */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999; /* 确保覆盖其他内容 */
}
.spinner-overlay lightning-spinner {
  margin-top: -100px; /* 负值将图标向上移动 */
}
    .THIS .x-accordion .x-accordion-group  .x-accordion-heading a .x-accordion-toggle {
        color: red!important;
        }
    host {
        --sds-c-accordion-summary-color-background: var(--lwc-colorBackground,rgb(160, 60, 60));
    }
    .THIS .slds-truncate {
        max-width: 100%;
        background: brown !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
@media (max-width: 768px) {
  th, td {
    display: block;
    width: 10%;
  }
}
force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.html
@@ -4,36 +4,61 @@
 * @Author: chen jing wu
 * @Date: 2023-04-20 17:16:48
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-13 13:42:39
 * @LastEditTime: 2023-10-03 12:02:30
-->
<template>
    <div class="holder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    <div if:true={IsLoading}>
        <div class="spinner-overlay">
            <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        </div>
    </div>
    <template if:true={visible}>
        <template if:true={isSuccess}>
            <div style="position:absolute;top:1rem;left:1rem;right:1rem;position: fixed;z-index: 9999;">
            <div class="slds-notify_container slds-is-relative" style="position:absolute;top:1rem;left:1rem;right:1rem;position: fixed;z-index: 9999;">
                <div class="slds-notify slds-notify_toast slds-theme_success" role="status">
                    <lightning-icon class="white" icon-name="utility:success" alternative-text="success"  variant="inverse" size="small" ></lightning-icon>
                  <div class="slds-notify__content"  style="padding-left: 20px;">
                    <h2 style="color:white;font-size:large">{message}</h2>
                  </div>
                  <div class="slds-notify__close">
                    <lightning-button-icon icon-name="utility:close"  variant="bare-inverse" size="large" onclick={closeAction}></lightning-button-icon>
                  </div>
                </div>
              </div>
            <!-- <div style="position:absolute;top:1rem;left:1rem;right:1rem;position: fixed;z-index: 9999;">
                <div class="slds-notify_container slds-is-relative">
                    <div class="slds-notify slds-notify_toast slds-theme_default slds-box slds-box_small"  style="background-color:rgb(46, 132, 74);" role="success">
                    <div class="slds-align_absolute-center">
                        <h2 style="color:white;font-size:large">{message}</h2>
                        <lightning-icon class="white" icon-name="utility:success" alternative-text="success" variant="Success" size="small" ></lightning-icon>
                    </div>
                    </div>
                </div>
            </div>
            </div> -->
        </template>
        <template if:false={isSuccess}>
            <div style="position:absolute;top:1rem;left:1rem;right:1rem;position: fixed;z-index: 9999;">
            <!-- <div style="position:absolute;top:1rem;left:1rem;right:1rem;position: fixed;z-index: 9999;">
                <div class="slds-notify_container slds-is-relative">
                    <div class="slds-notify slds-notify_toast slds-theme_default slds-box slds-box_small"  style="background-color:rgb(234, 0, 30);" role="success">
                    <div class="slds-align_absolute-center">
                        <h2 style="color:white;font-size:large">{message}</h2>
                        <lightning-icon class="white" icon-name="utility:error" alternative-text="error" variant="Error" size="small" ></lightning-icon>
                    <div class="slds-align_right">
                    </div>
                    </div>
                </div>
            </div>
            </div> -->
            <div class="slds-notify_container slds-is-relative" style="position:absolute;top:1rem;left:1rem;right:1rem;position: fixed;z-index: 9999;">
                <div class="slds-notify slds-notify_toast slds-theme_error" role="status">
                    <lightning-icon class="white" icon-name="utility:error"  size="small" variant="inverse"></lightning-icon>
                  <div class="slds-notify__content" style="padding-left: 20px;">
                    <h2 style="color:white;font-size:large">{message}</h2>
                  </div>
                  <div class="slds-notify__close">
                    <lightning-button-icon icon-name="utility:close" variant="bare-inverse" size="large" onclick={closeAction}></lightning-button-icon>
                  </div>
                </div>
              </div>
        </template>
    </template>
    <template if:true={isInit}>
@@ -46,9 +71,9 @@
                                <div class="mainTitle" style="padding: 10px 3px;font-weight: bold;font-size: large">失单报告编辑页面</div>
                            </lightning-layout-item>
                                <lightning-layout-item alignment-bump="left">
                                    <lightning-button label="追加品牌" onclick={addBrandJs}></lightning-button>
                                    <lightning-button name="save" label="保存" onclick={saveBrandJs}></lightning-button>
                                    <lightning-button label="返回询价" onclick={cancel}></lightning-button>
                                    <lightning-button class="slds-button lexBorder" label="追加品牌" onclick={addBrandJs}></lightning-button>
                                    <lightning-button class="slds-button lexBorder1" name="save" label="保存" onclick={saveBrandJs}></lightning-button>
                                    <lightning-button class="slds-button lexBorder" label="返回询价" onclick={cancel}></lightning-button>
                                </lightning-layout-item>
                        </lightning-layout>
                    </div>
@@ -85,13 +110,18 @@
                                </lightning-layout-item>
                            </template>
                        </lightning-layout>
                                <lightning-accordion active-section-name="失单品牌" allow-multiple-sections-open="true" class="myAccordion">
                                <template if:true={LostReport.LostBrands}>
                                    <lightning-accordion active-section-name={brandTitle} allow-multiple-sections-open="true" class="example-accordion">
                                        <template for:each={LostReport.LostBrands} for:item="brand" for:index="i">
                                            <li key={brand.lineNo}>
                                                <div class= "x-accordion-heading">
                                                    <lightning-accordion-section active-section-name="失单品牌" class="" data-id={i} name="失单品牌" label="失单品牌" active="true">
                                                        <lightning-button name="save" label="保存" onclick={saveBrandJs}></lightning-button>
                                                        <lightning-button name={i} label="删除" onclick={deleteBrandJs} disabled={isBrandCount2}></lightning-button>
                                                    <lightning-accordion-section  class="" data-id={i} name={brand.brandTitle} label={brand.brandTitle} active>
                                                        <lightning-layout>
                                                            <lightning-layout-item alignment-bump="left">
                                                                <lightning-button style="margin-top: 10px;" class="slds-button lexBorder1" name="save" label="保存" onclick={saveBrandJs}></lightning-button>
                                                                <lightning-button class="slds-button lexBorder1" name={i} label="删除" onclick={deleteBrandJs} disabled={isBrandCount2}></lightning-button>
                                                            </lightning-layout-item>
                                                        </lightning-layout>
                                                        <lightning-layout>
                                                            <lightning-layout-item size="4" padding="around-small">
                                                                <template if:true={isEdit}>
@@ -130,64 +160,99 @@
                                                            <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>
                                                            <template if:true={brand.reasonFlag}>
                                                                <lightning-layout-item size="4" padding="horizontal-small">
                                                                    <lightning-combobox name={i} label="渠道具体原因:" value={brand.lostBrand.ChannelSpecificReasons__c} options={reasonOptions}
                                                                    onchange={handleChannelSpecificReasonChange} placeholder="--无--" required></lightning-combobox>
                                                                </lightning-layout-item>
                                                            </template>
                                                        </lightning-layout>
                                                        <lightning-layout>
                                                            <lightning-layout-item flexibility="auto" padding="around-small">
                                                                <template if:true={isInit}>
                                                                    <div class="slds-card__body slds-card__body_inner">
                                                                        <table class="slds-table slds-table_bordered slds-table_cell-buffer slds-var-m-bottom_large">
                                                                    <div class=" table-container">
                                                                        <table class="custom-table slds-table slds-table_bordered slds-table_cell-buffer slds-var-m-bottom_large" style="max-width: 99%;">
                                                                            <thead>
                                                                                <tr class="slds-text-title_caps">
                                                                                        <th><div class="slds-truncate">失单品牌</div></th>
                                                                                        <th><div class="slds-truncate">失单对手型号</div></th>
                                                                                        <th><div class="slds-truncate"><span style="color:red;font-size: 10px;">*</span>失单数量</div></th>
                                                                                        <!-- <th style="width: 13%;"><div class="slds-truncate">失单品牌</div></th>
                                                                                        <th style="width: 21%;"><div class="slds-truncate">失单对手型号</div></th>
                                                                                        <th style="width: 5%;"><div class="slds-truncate"><span style="color:red;font-size: 10px;">*</span>失单数量</div></th>
                                                                                        <th style="width: 10%;"><div class="slds-truncate">失单对手型号(手动)</div></th>
                                                                                        <th style="width: 10%;"><div class="slds-truncate"><span style="color:red;font-size: 10px;">*</span>失单产品类别</div></th>
                                                                                        <th style="width: 15%;"><div class="slds-truncate"><span style="color:red;font-size: 10px;">*</span>失单产品区分</div></th>
                                                                                        <th></th> -->
                                                                                        <th style="width: 161px;"><div class="slds-truncate">失单品牌</div></th>
                                                                                        <th style="width: 250px;"><div class="slds-truncate">失单对手型号</div></th>
                                                                                        <th style="width: 60px;"><div class="slds-truncate"><span style="color:red;font-size: 10px;">*</span>失单数量</div></th>
                                                                                        <th><div class="slds-truncate">失单对手型号(手动)</div></th>
                                                                                        <th><div class="slds-truncate"><span style="color:red;font-size: 10px;">*</span>失单产品类别</div></th>
                                                                                        <th><div class="slds-truncate"><span style="color:red;font-size: 10px;">*</span>失单产品区分</div></th>
                                                                                        <th></th>
                                                                                        <th style="width: 105px;"><div class="slds-truncate"><span style="color:red;font-size: 10px;">*</span>失单产品类别</div></th>
                                                                                        <th style="width: 166px;"><div class="slds-truncate"><span style="color:red;font-size: 10px;">*</span>失单产品区分</div></th>
                                                                                        <th style="width: 80px;"></th>
                                                                                </tr>
                                                                            </thead>
                                                                            <tbody>
                                                                                <template for:each={brand.LostProducts} for:item="product" for:index="j">
                                                                                    <tr class="inputRows" key={product.lineNo2}>
                                                                                        <td>
                                                                                           <lightning-combobox placeholder={product.LostProductss.LostBrandName__c} data-id={i} class="BrandName" name={j} title={i} options={brandOptions} value={product.LostProductss.LostBrandName__c} onchange={handleLostBrandNameChange} read-only="true" style="margin-bottom: 20px; width: 130px"></lightning-combobox>
                                                                                           <lightning-combobox placeholder={product.LostProductss.LostBrandName__c} data-id={i} class="BrandName" name={j} title={i} options={brandOptions} value={product.LostProductss.LostBrandName__c} onchange={handleLostBrandNameChange} read-only="true"></lightning-combobox>
                                                                                        </td>
                                                                                        <td>
                                                                                            <template if:true={isEdit}>
                                                                                                <div style="padding-bottom: 17px;">
                                                                                                    <c-lex-lookup-lwc onbuttonclick={handleCustomButtonClick} class="Product" data-id={i} title={i} name={j} iconname="standard:product_item" query-brand={product.LostProductss.LostBrandName__c} objectname="Product2" onchange={handleClear} onselected={handleSelected} init-value={product.productName} style="margin-bottom: 17px;"></c-lex-lookup-lwc>
                                                                                                <div style="padding-top: 4px;">
                                                                                                    <template if:false={product.LostProductss.LostProduct__r}>
                                                                                                        <c-lex-lookup-lwc onbuttonclick={handleCustomButtonClick} class="Product" data-id={i} title={i} name={j} iconname="standard:product_item" query-brand={product.LostProductss.LostBrandName__c} objectname="Product2" onchange={handleClear} onselected={handleSelected} init-value={product.productName} style="margin-bottom: 17px;"></c-lex-lookup-lwc>
                                                                                                    </template>
                                                                                                    <template if:true={product.LostProductss.LostProduct__r}>
                                                                                                        <c-lex-lookup-lwc onbuttonclick={handleCustomButtonClick} class="Product" data-id={i} title={i} name={j} iconname="standard:product_item" query-brand={product.LostProductss.LostBrandName__c} objectname="Product2" onchange={handleClear} onselected={handleSelected} init-value={product.LostProductss.LostProduct__r.Name} style="margin-bottom: 17px;"></c-lex-lookup-lwc>
                                                                                                    </template>
                                                                                                </div> 
                                                                                            </template>
                                                                                            <template if:false={isEdit}>
                                                                                                <div style="padding-bottom: 17px;">
                                                                                                <div style="padding-top: 4px;">
                                                                                                    <c-lex-lookup-lwc onbuttonclick={handleCustomButtonClick} class="Product" data-id={i} title={i} name={j} iconname="standard:product_item" query-brand={product.LostProductss.LostBrandName__c} objectname="Product2" onchange={handleClear} onselected={handleSelected} style="margin-bottom: 17px;"></c-lex-lookup-lwc>
                                                                                                </div>
                                                                                            </template>
                                                                                        </td>
                                                                                        <td>
                                                                                           <lightning-input class="Quantity" title={i} name={j} value={product.LostProductss.Quantity__c} onchange={handleQuantityChange} style="margin-bottom: 20px;"></lightning-input>
                                                                                        <td style="width: 5%;">
                                                                                           <lightning-input class="Quantity" title={i} name={j} value={product.LostProductss.Quantity__c} onchange={handleQuantityChange} style=""></lightning-input>
                                                                                        </td>
                                                                                        <td>
                                                                                            <lightning-input class="LostProductMannual" title={i} name={j} value={product.LostProductss.LostProductMannual__c} onchange={handleLostProductMannualChange} style="margin-bottom: 20px;"></lightning-input>
                                                                                            <lightning-input class="LostProductMannual" title={i} name={j} value={product.LostProductss.LostProductMannual__c} onchange={handleLostProductMannualChange} style=""></lightning-input>
                                                                                        </td>
                                                                                        <td>
                                                                                            <lightning-combobox class="ProductClass" data-id={i} placeholder="--无--" title={i} name={j} options={productClassOptions} value={product.LostProductss.ProductClass__c} onchange={handleProductClassChange} style="margin-bottom: 20px; width: 87px"></lightning-combobox>
                                                                                            <template if:true={isEdit}>
                                                                                                <lightning-combobox read-only="true" class="ProductClass" data-id={i} placeholder="--无--" title={i} name={j} options={productClassOptions} value={product.LostProductss.ProductClass__c} onchange={handleProductClassChange}></lightning-combobox>
                                                                                                <!-- <template if:true={product.LostProductss.ProductClass__c}>
                                                                                                    <lightning-combobox read-only="true" class="ProductClass" data-id={i} placeholder="--无--" title={i} name={j} options={productClassOptions} value={product.LostProductss.ProductClass__c} onchange={handleProductClassChange}></lightning-combobox>
                                                                                                </template>
                                                                                                <template if:false={product.LostProductss.ProductClass__c}>
                                                                                                    <lightning-combobox class="ProductClass" data-id={i} placeholder="--无--" title={i} name={j} options={productClassOptions} value={product.LostProductss.ProductClass__c} onchange={handleProductClassChange}></lightning-combobox>
                                                                                                </template> -->
                                                                                            </template>
                                                                                            <template if:false={isEdit}>
                                                                                                <lightning-combobox class="ProductClass" data-id={i} placeholder="--无--" title={i} name={j} options={productClassOptions} value={product.LostProductss.ProductClass__c} onchange={handleProductClassChange}></lightning-combobox>
                                                                                            </template>
                                                                                        </td>
                                                                                        <td>
                                                                                            <lightning-combobox class="ProductCategory" data-id={i} placeholder="--无--" title={i} name={j} options={product.productOptions} value={product.LostProductss.ProductCategory__c} onchange={handleProductCategoryChange} read-only="true" style="margin-bottom: 20px; width: 87px"></lightning-combobox>
                                                                                            <template if:true={isEdit}>
                                                                                                <lightning-combobox class="ProductCategory" data-id={i} placeholder={product.LostProductss.ProductCategory__c} title={i} name={j} options={product.productOptions} value={product.LostProductss.ProductCategory__c} onchange={handleProductCategoryChange} read-only="true"></lightning-combobox>
                                                                                            </template>
                                                                                            <template if:false={isEdit}>
                                                                                                <lightning-combobox class="ProductCategory" data-id={i} placeholder="--无--" title={i} name={j} options={product.productOptions} value={product.LostProductss.ProductCategory__c} onchange={handleProductCategoryChange} read-only="true"></lightning-combobox>
                                                                                            </template>
                                                                                        </td>
                                        
                                                                                        <td>
                                                                                            <lightning-button-icon name={i} icon-name="utility:add" value={j} variant="bare" onclick={addRow}></lightning-button-icon>
                                                                                                <lightning-button-icon name={i} icon-name="utility:add" value={j} variant="bare" onclick={addRow}></lightning-button-icon>
                                                                                                <lightning-button-icon style="padding-left: 15px;" class="iconButton" data-id={i} name={i} icon-name="utility:delete" value={j} variant="bare" onclick={removeRow}></lightning-button-icon>
                                                                                        </td>
                                                                                        <td>
                                                                                            <lightning-button-icon class="deleteButton" data-id={i} name={i} icon-name="utility:delete" value={j} variant="bare" onclick={removeRow}></lightning-button-icon>
                                                                                        </td>
                                                                                    </tr>
                                                                                </template>
                                                                            </tbody>
@@ -202,15 +267,17 @@
                                            </li>
                                        </template>                               
                            </lightning-accordion>
                                </template>
                    </div> 
                    <div style="margin-top: 5px">
                        <div class="slds-box slds-p-around_medium slds-text-align_center">
                            <lightning-layout style="margin-top: 20px;">
                                <div class="slds-align_absolute-center">
                                    <lightning-layout-item size="12">
                                        <lightning-button label="追加品牌" onclick={addBrandJs}></lightning-button>
                                        <lightning-button name="save" label="保存" onclick={saveBrandJs}></lightning-button>
                                        <lightning-button label="返回询价" onclick={cancel}></lightning-button>
                                        <lightning-button class="slds-button lexBorder" label="追加品牌" onclick={addBrandJs}></lightning-button>
                                        <lightning-button class="slds-button lexBorder1" name="save" label="保存" onclick={saveBrandJs}></lightning-button>
                                        <lightning-button class="slds-button lexBorder" label="返回询价" onclick={cancel}></lightning-button>
                                    </lightning-layout-item>
                                </div>
                            </lightning-layout>
@@ -228,91 +295,94 @@
                                    <div class="mainTitle" style="padding: 10px 3px;font-weight: bold;font-size: large">失单报告查看页面</div>
                                </lightning-layout-item>
                                    <lightning-layout-item alignment-bump="left">
                                        <template if:false={submitFlag}>
                                            <lightning-button label="提交" onclick={submitJs}></lightning-button>
                                        <template if:true={isCanSubmit}>
                                            <lightning-button class="slds-button lexBorder1" label="提交" onclick={submitJs}></lightning-button>
                                        </template>
                                        <lightning-button name="编辑" label="编辑" onclick={editJs}></lightning-button>
                                        <lightning-button label="返回询价" onclick={cancel}></lightning-button>
                                        <template if:true={isCanEdit}>
                                            <lightning-button class="slds-button lexBorder1" name="编辑" label="编辑" onclick={editJs}></lightning-button>
                                        </template>
                                        <lightning-button class="slds-button lexBorder" label="返回询价" onclick={cancel}></lightning-button>
                                    </lightning-layout-item>
                            </lightning-layout>
                            <lightning-layout>
                                <lightning-layout-item size="1">
                                    <label>失单类型:</label>
                                <lightning-layout-item size="3" padding="around-small">
                                    <div style="float: left;padding-top: 17px;">失单类型:
                                        <span style="margin-left: 5px;">{LostReport.lostReport.LostType__c}</span>
                                    </div>
                                </lightning-layout-item>
                                <lightning-layout-item size="1">
                                    <lightning-record-view-form object-api-name="Lost_cancel_report__c" record-id={LostReport.lostReport.Id} density="comfy">
                                        <lightning-output-field field-name="LostType__c" variant="label-hidden"></lightning-output-field>
                                    </lightning-record-view-form>
                                <lightning-layout-item size="3" padding="around-small">
                                    <div style="float: left;padding-top: 17px;">失单总金额(元):
                                        <span style="margin-left: 5px;">{LostReport.lostReport.LostTotalAmount__c}</span>
                                        <!-- {LostReport.lostReport.LostTotalAmount__c} -->
                                    </div>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item size="1">
                                    <label>失单总金额(元):</label>
                                <lightning-layout-item size="3" padding="around-small">
                                    <div style="float: left;padding-top: 17px;">包含超声:
                                        <span style="margin-left: 5px;">{LostReport.lostReport.InclusionUltrasound__c}</span>
                                        <!-- {LostReport.lostReport.InclusionUltrasound__c} -->
                                    </div>
                                </lightning-layout-item>
                                <lightning-layout-item size="1">
                                    <lightning-record-view-form object-api-name="Lost_cancel_report__c" record-id={LostReport.lostReport.Id} density="comfy">
                                        <lightning-output-field field-name="LostTotalAmount__c" variant="label-hidden"></lightning-output-field>
                                    </lightning-record-view-form>
                                <lightning-layout-item size="3" padding="around-small">
                                    <template if:true={editStatus}>
                                        <div style="float: left;padding-top: 17px;">状态:
                                            <span style="margin-left: 5px;">{editStatus}</span>
                                            <!-- {LostReport.lostReport.Report_Status__c} -->
                                        </div>
                                    </template>
                                    <template if:false={editStatus}>
                                        <div style="float: left;padding-top: 17px;">状态:
                                            <span style="margin-left: 5px;">{LostReport.lostReport.Report_Status__c}</span>
                                            <!-- {LostReport.lostReport.Report_Status__c} -->
                                        </div>
                                    </template>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item size="1">
                                    <label>包含超声:</label>
                                </lightning-layout-item>
                                <lightning-layout-item size="1">
                                    <lightning-record-view-form object-api-name="Lost_cancel_report__c" record-id={LostReport.lostReport.Id} density="comfy">
                                        <lightning-output-field field-name="InclusionUltrasound__c" variant="label-hidden"></lightning-output-field>
                                    </lightning-record-view-form>
                                </lightning-layout-item>
                                <lightning-layout-item size="1"></lightning-layout-item>
                                <lightning-layout-item size="1">
                                    <label>状态:</label>
                                </lightning-layout-item>
                                <lightning-layout-item size="1">
                                    <lightning-record-view-form object-api-name="Lost_cancel_report__c" record-id={LostReport.lostReport.Id} density="comfy">
                                        <lightning-output-field field-name="Report_Status__c" variant="label-hidden"></lightning-output-field>
                                    </lightning-record-view-form>
                                </lightning-layout-item>
                            </lightning-layout>
                        </div>
                        <div style="margin-top: 5px">
                            <div class="slds-box slds-p-around_medium">
                                <lightning-accordion allow-multiple-sections-open class="myAccordion" active-section-name="失单品牌">
                                <lightning-accordion allow-multiple-sections-open class="myAccordion" active-section-name={brandTitle}>
                                    <template for:each={LostReport.LostBrands} for:item="brand" for:index="i">
                                        <li key={brand.lostBrand.Id}>
                                            <lightning-accordion-section  class="text-container" data-id={i} name="失单品牌" label="失单品牌" active>
                                            <lightning-accordion-section  class="text-container" data-id={i} name={brand.brandTitle} label={brand.brandTitle} active>
                                                    <lightning-layout>
                                                        <lightning-layout-item size="2" style="border-width: 1px;border-bottom-style: groove;border-bottom-color: silver;">
                                                            <label>失单品牌:</label>
                                                        <lightning-layout-item style="width: 135px;height: 30px;"></lightning-layout-item>
                                                    </lightning-layout>
                                                    <lightning-layout>
                                                        <lightning-layout-item style="width: 135px;height: 30px;">
                                                            <label>失单品牌:</label>
                                                        </lightning-layout-item>
                                                        <lightning-layout-item size="3" style="border-width: 1px;border-bottom-style: groove;border-bottom-color: silver;">
                                                        <lightning-layout-item size="3">
                                                            <lightning-record-view-form object-api-name="PCLLostBrand__c" record-id={brand.lostBrand.Id} density="comfy">
                                                                <lightning-output-field field-name="Lost_By_Company__c" variant="label-hidden"></lightning-output-field>
                                                            </lightning-record-view-form> 
                                                        </lightning-layout-item>
                                                        <lightning-layout-item size="2"></lightning-layout-item>
                                                        <lightning-layout-item size="2" style="border-width: 1px;border-bottom-style: groove;border-bottom-color: silver;">
                                                            <label>失单品牌(手动):</label>
                                                        <lightning-layout-item size="3"></lightning-layout-item>
                                                        <lightning-layout-item style="width: 135px;">
                                                            <label>失单品牌(手动):</label>
                                                        </lightning-layout-item>
                                                        <lightning-layout-item size="3" style="border-width: 1px;border-bottom-style: groove;border-bottom-color: silver;">
                                                        <lightning-layout-item size="3">
                                                            <lightning-record-view-form object-api-name="PCLLostBrand__c" record-id={brand.lostBrand.Id} density="comfy">
                                                                <lightning-output-field field-name="Lost_By_Company_Mannual__c" variant="label-hidden"></lightning-output-field>
                                                            </lightning-record-view-form> 
                                                        </lightning-layout-item>
                                                    </lightning-layout>
                                                    <lightning-layout>
                                                        <lightning-layout-item size="2" style="border-width: 1px;border-bottom-style: groove;border-bottom-color: silver;">
                                                            <label>失单原因(主):</label>
                                                        <lightning-layout-item style="width: 135px;height: 30px;">
                                                            <label>失单原因(主):</label>
                                                        </lightning-layout-item>
                                                        <lightning-layout-item size="3" style="border-width: 1px;border-bottom-style: groove;border-bottom-color: silver;">
                                                        <lightning-layout-item size="3">
                                                            <lightning-record-view-form object-api-name="PCLLostBrand__c" record-id={brand.lostBrand.Id} density="comfy">
                                                                <lightning-output-field field-name="Lost_reason_main__c" variant="label-hidden"></lightning-output-field>
                                                            </lightning-record-view-form> 
                                                        </lightning-layout-item>
                                                        <lightning-layout-item size="2"></lightning-layout-item>
                                                        <lightning-layout-item size="2" style="border-width: 1px;border-bottom-style: groove;border-bottom-color: silver;">
                                                            <label>失单原因(次):</label>
                                                        <lightning-layout-item size="3"></lightning-layout-item>
                                                        <lightning-layout-item style="width: 135px;">
                                                            <label>失单原因(次):</label>
                                                        </lightning-layout-item>
                                                        <lightning-layout-item size="3" style="border-width: 1px;border-bottom-style: groove;border-bottom-color: silver;">
                                                        <lightning-layout-item size="3">
                                                            <lightning-record-view-form object-api-name="PCLLostBrand__c" record-id={brand.lostBrand.Id} density="comfy">
                                                                <lightning-output-field field-name="Lost_Reason_Sub__c" variant="label-hidden"></lightning-output-field>
                                                            </lightning-record-view-form>
@@ -321,50 +391,61 @@
                                                    </lightning-layout>
                                                    <lightning-layout> 
                                                        
                                                        <lightning-layout-item size="2" style="border-width: 1px;border-bottom-style: groove;border-bottom-color: silver;">
                                                            <label>中标经销商:</label>
                                                        <lightning-layout-item style="width: 135px;height: 30px;">
                                                            <label>中标经销商:</label>
                                                        </lightning-layout-item>
                                                        <lightning-layout-item size="3" style="border-width: 1px;border-bottom-style: groove;border-bottom-color: silver;">
                                                        <lightning-layout-item size="3">
                                                            <lightning-record-view-form object-api-name="PCLLostBrand__c" record-id={brand.lostBrand.Id} density="comfy">
                                                                <lightning-output-field field-name="Agency__c" variant="label-hidden"></lightning-output-field>
                                                            </lightning-record-view-form> 
                                                        </lightning-layout-item>
                                                        <lightning-layout-item size="2"></lightning-layout-item>
                                                        <lightning-layout-item size="2" style="border-width: 1px;border-bottom-style: groove;border-bottom-color: silver;">
                                                            <label>中标经销商(手动):</label>
                                                        <lightning-layout-item size="3"></lightning-layout-item>
                                                        <lightning-layout-item style="width: 135px;">
                                                            <label>中标经销商(手动):</label>
                                                        </lightning-layout-item>
                                                        <lightning-layout-item size="3" style="border-width: 1px;border-bottom-style: groove;border-bottom-color: silver;">
                                                        <lightning-layout-item size="3">
                                                            <lightning-record-view-form object-api-name="PCLLostBrand__c" record-id={brand.lostBrand.Id} density="comfy">
                                                                <lightning-output-field field-name="AgencyMannual__c" variant="label-hidden"></lightning-output-field>
                                                            </lightning-record-view-form> 
                                                        </lightning-layout-item>
                                                    </lightning-layout>
                                                    <lightning-layout>
                                                        <lightning-layout-item size="2" style="border-width: 1px;border-bottom-style: groove;border-bottom-color: silver;">
                                                            <label>失单金额(元):</label>
                                                        <lightning-layout-item style="width: 135px;height: 30px;">
                                                            <label>失单金额(元):</label>
                                                        </lightning-layout-item>
                                                        <lightning-layout-item size="3" style="border-width: 1px;border-bottom-style: groove;border-bottom-color: silver;">
                                                        <lightning-layout-item size="3">
                                                            <lightning-record-view-form object-api-name="PCLLostBrand__c" record-id={brand.lostBrand.Id} density="comfy">
                                                                <lightning-output-field field-name="LostPrice__c" variant="label-hidden"></lightning-output-field>
                                                            </lightning-record-view-form> 
                                                        </lightning-layout-item>
                                                        <lightning-layout-item size="3"></lightning-layout-item>
                                                        <template if:true={brand.lostBrand.ChannelSpecificReasons__c}>
                                                            <lightning-layout-item style="width: 135px;">
                                                                <label>渠道具体原因:</label>
                                                            </lightning-layout-item>
                                                            <lightning-layout-item size="3">
                                                            <lightning-record-view-form object-api-name="PCLLostBrand__c" record-id={brand.lostBrand.Id} density="comfy">
                                                                <lightning-output-field field-name="ChannelSpecificReasons__c" variant="label-hidden"></lightning-output-field>
                                                            </lightning-record-view-form>
                                                            </lightning-layout-item>
                                                        </template>
                                                    </lightning-layout>
                                                
                                                <lightning-layout>
                                                    <lightning-layout-item flexibility="auto" padding="around-small">
                                                    <lightning-layout-item flexibility="auto" padding="around-small" style="padding-left: 0px;">
                                                        <!-- <template if:true={isInit}>
                                                            <lightning-datatable hide-checkbox-column="true" key-field="is" columns={columns3} data={getData}></lightning-datatable>
                                                        </template> -->
                                                        <template if:true={isInit}>
                                                            <table class="slds-table slds-table_bordered slds-table_cell-buffer slds-var-m-bottom_large">
                                                            <table  class="custom-table slds-table slds-table_bordered slds-table_cell-buffer slds-var-m-bottom_large">
                                                                <thead>
                                                                    <tr class="slds-text-title_caps">
                                                                            <th><div class="slds-truncate">失单品牌</div></th>
                                                                            <th><div class="slds-truncate">失单对手型号</div></th>
                                                                            <th><div class="slds-truncate">失单数量</div></th>
                                                                            <th style="width: 145px;"><div class="slds-truncate">失单品牌</div></th>
                                                                            <th style="width: 370px;"><div class="slds-truncate">失单对手型号</div></th>
                                                                            <th style="width: 60px;"><div class="slds-truncate">失单数量</div></th>
                                                                            <th><div class="slds-truncate">失单对手型号(手动)</div></th>
                                                                            <th><div class="slds-truncate">失单产品类别</div></th>
                                                                            <th><div class="slds-truncate">失单产品区分</div></th>
                                                                            <th style="width: 100px;"><div class="slds-truncate">失单产品类别</div></th>
                                                                            <th style="width: 145px;"><div class="slds-truncate">失单产品区分</div></th>
                                                                    </tr>
                                                                </thead>
                                                                <tbody>
@@ -373,11 +454,18 @@
                                                                            <td>
                                                                                <div>{product.LostProductss.LostBrandName__c}</div>
                                                                            </td>
                                                                            <template if:false={product.LostProductss.LostProduct__r}>
                                                                                <td>
                                                                                    <div>{product.productName}</div>
                                                                                </td>
                                                                            </template>
                                                                            <template if:true={product.LostProductss.LostProduct__r}>
                                                                                <td>
                                                                                    <div>{product.LostProductss.LostProduct__r.Name}</div>
                                                                                </td>
                                                                            </template>
                                                                            <td>
                                                                                <div>{product.productName}</div>
                                                                            </td>
                                                                            <td>
                                                                                <div>{product.LostProductss.Quantity__c}</div>
                                                                                <div style="float: right;">{product.LostProductss.Quantity__c}</div>
                                                                            </td>
                                                                            <td>
                                                                                <div>{product.LostProductss.LostProductMannual__c}</div>
@@ -404,31 +492,39 @@
                                <lightning-layout style="margin-top: 20px;">
                                    <div class="slds-align_absolute-center">
                                        <lightning-layout-item size="12">
                                            <template if:false={submitFlag}>
                                                <lightning-button label="提交" onclick={submitJs}></lightning-button>
                                            <template if:true={isCanSubmit}>
                                                <lightning-button class="slds-button lexBorder1" label="提交" onclick={submitJs}></lightning-button>
                                            </template>
                                            <lightning-button name="编辑" label="编辑" onclick={editJs}></lightning-button>
                                            <lightning-button label="返回询价" onclick={cancel}></lightning-button>
                                            <template if:true={isCanEdit}>
                                                <lightning-button class="slds-button lexBorder1" name="编辑" label="编辑" onclick={editJs}></lightning-button>
                                            </template>
                                            <lightning-button class="slds-button lexBorder" label="返回询价" onclick={cancel}></lightning-button>
                                        </lightning-layout-item>
                                    </div>
                                </lightning-layout>
                            </div> 
                        </div>
                        <template if:true={submitFlag}>
                        <template if:true={haveApprovalHistorys}>
                            <div class="slds-box slds-p-around_medium slds-text-align_center">
                                <lightning-layout>
                                    <lightning-layout-item>
                                        <div class="mainTitle" style="padding: 10px 3px;font-weight: bold;font-size: large">批准历史</div>
                                    </lightning-layout-item>
                                    <lightning-layout-item alignment-bump="left">
                                        <lightning-button label="撤回批准请求" onclick={onApproveChange}></lightning-button>
                                        <template if:false={isCaoAn}>
                                            <lightning-button class="slds-button lexBorder1" label="批准" onclick={handleSubmitApp}></lightning-button>
                                            <lightning-button class="slds-button lexBorder1" label="拒绝" onclick={handleNoApp}></lightning-button>
                                            <lightning-button class="slds-button lexBorder" label="重新分配" onclick={handleReStartApp}></lightning-button>
                                            <lightning-button class="slds-button lexBorder3" label="撤回批准请求" onclick={handleCancelApp}></lightning-button>
                                        </template>
                                    </lightning-layout-item>
                                </lightning-layout>
                                <lightning-layout>
                                    <table class="slds-table slds-table_bordered slds-table_cell-buffer slds-var-m-bottom_large">
                                    <table class="custom-table slds-table slds-table_bordered slds-table_cell-buffer slds-var-m-bottom_large">
                                        <thead>
                                            <tr class="slds-text-title_caps">
                                                    <th><div class="slds-truncate">操作</div></th>
                                                    <!-- <th><div class="slds-truncate">操作</div></th> -->
                                                    <th><div class="slds-truncate">日期</div></th>
                                                    <th><div class="slds-truncate">状态</div></th>
                                                    <th><div class="slds-truncate">被分配人</div></th>
@@ -439,13 +535,14 @@
                                        <tbody>
                                            <template for:each={LostReport.approvalHistorys} for:item="approvalHistory" for:index="j">
                                                <tr class="inputRows" key={approvalHistory.Id}>
                                                    <td>
                                                    <!-- <td>
                                                        <template if:true={approvalHistory.IsPending}>
                                                            <a onclick={onApproveChange}>重新分配</a>
                                                            <label>&nbsp;</label>
                                                            <label>|</label>
                                                            <a onclick={onApproveChange}>批准/拒绝</a>
                                                        </template>
                                                    </td>
                                                    </td> -->
                                                    <td>
                                                        <div>{approvalHistory.CreatedDate}</div>
                                                    </td>
@@ -471,5 +568,53 @@
                    </div>   
                </lightning-card>
        </template>
        <template if:true={isPop}>
            <section role="dialog" aria-labelledby="modal-heading-01" aria-describedby="modal-content-id-1" tabindex="-1" aria-modal="true" class="slds-modal slds-fade-in-open " data-aura-rendered-by="478:0">
                <div style="height: 50px;"></div>
                <div style="background-color: white;height:200px;" class="slds-modal__container" data-aura-rendered-by="479:0">
                    <template if:false={isLookup}>
                        <div style="align-self: center;font-size: large;padding-bottom: 10px" slot="header">{modalsubmitLabel}页面</div>
                        <div style="height: 100px;">
                            <lightning-textarea class="comment" style="width: 95%;padding-left: 10px;" data-id="comment" label="评论" value=""></lightning-textarea>
                        </div>
                    </template>
                    <template if:true={isLookup}>
                        <div style="align-self: center;font-size: large;padding-bottom: 36px" slot="header">{modalsubmitLabel}页面</div>
                        <lightning-layout-item size="10" style="align-self: center;">
                            <div>
                                <lightning-record-edit-form
                                    object-api-name='Lost_Report__c'
                                    record-id=''
                                >
                                    <lightning-input-field variant="label-hidden" value={newActorId} field-name='Manager__c' onchange={handleActorChange} required> </lightning-input-field>
                                </lightning-record-edit-form>
                              </div>
                        </lightning-layout-item>
                    </template>
                    <div slot="footer" style="align-self: center;padding-top: 10px;">
                        <lightning-button
                          data-id="Cancel"
                          label="取消"
                          onclick={handleModalCancel}
                        ></lightning-button>
                        <lightning-button
                          data-id="Submit"
                          label={modalsubmitLabel}
                          variant="brand"
                          class="slds-p-left_small"
                          onclick={handleModalSubmit}
                        ></lightning-button>
                    </div>
                </div>
            </section>
            <div class="slds-backdrop slds-backdrop_open"></div>
        </template>
    </template>
</template>
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-13 13:45:33
 * @LastEditTime: 2023-10-03 11:54:18
 */
let columns2=[
    { label: '--无--', value: '' },
@@ -33,8 +33,10 @@
    { label: '--无--', value: '' },
    { label: '主机', value: '主机' },
    { label: '镜子', value: '镜子' },
    { label: '洗消机', value: '洗消机' },
    { label: '小镜种', value: '小镜种' },
    { label: '能量', value: '能量' },
    { label: '光源', value: '光源' },
    { label: '其他', value: '其他' }
];
const productCategoryOptions = [
@@ -79,7 +81,12 @@
import {CloseActionScreenEvent} from 'lightning/actions'; 
import lexLookupLwc from 'c/lexLookupLwc';
import searchProduct from '@salesforce/apex/lexPCLLostReportLwcController.searchProduct';
import { updateRecord } from 'lightning/uiRecordApi';
import { updateRecord,getRecord } from 'lightning/uiRecordApi';
import { refreshApex } from '@salesforce/apex';
import submitForApproval from '@salesforce/apex/lexPCLLostReportLwcController.submitForApproval';
import reassignStep from '@salesforce/apex/lexPCLLostReportLwcController.reassignStep';
import getUserProfileId from '@salesforce/apex/lexPCLLostReportLwcController.getUserProfileId';
import PCLReportProfileId from '@salesforce/label/c.PCLReportProfileId';
export default class LexPCLLostReportPage extends NavigationMixin(LightningElement) {
    @track visible = false;
    @wire(CurrentPageReference) pageRef;
@@ -88,6 +95,12 @@
    @track status = {
        pageStatus: 'Create'
      }
    newActorId = null;
    newReport;
    action;
    isLookup;
    modalsubmitLabel;
    @track isPop;
    @track message;
    @track isSuccess;
    @track LostReport = {
@@ -95,6 +108,8 @@
        ],
        lostReport: {}
    }
    editStatus;
    reasonOptions = reasonOptions;
    @track brandOptions = [];
    @track isInit = false;
    lostType = '失单';
@@ -115,6 +130,16 @@
    deleteProductIdList = [];
    IsLoading;
    newApprovalHistorys;
    userProfileId;
    @wire(getUserProfileId)
    wiredUserProfileId({ error, data }) {
        if (data) {
            this.userProfileId = data;
            console.log(this.userProfileId + 'user');
        } else if (error) {
            // 处理错误
        }
    }
    handleCustomButtonClick(event) {
        try {
            var index1 = event.target.title;
@@ -148,14 +173,40 @@
                    this.LostReport = result.LostReport;
                }else{
                    this.showToast(result.message,"error");
                    setTimeout(() => {
                        window.location = '/lightning/r/Opportunity/' + this.oppId + '/view';
                    }, 2000);
                }  
            }else{
                if(result.LostReport.lostReport.Report_Status__c == '申请中'){
                    this.editStatus = '申请中';
                    console.log('shenqingzhong');
                }else if(result.LostReport.lostReport.Report_Status__c == '批准'){
                    this.editStatus = '批准';
                    console.log('pizhun');
                }
                var report = result.LostReport;
                this.LostReport = report;
                this.LostReport.lostReport.LostTotalAmount__c = 0.0;
                this.LostReport.lostReport.InclusionUltrasound__c = '0';
                if(!this.LostReport.lostReport.LostTotalAmount__c){
                    this.LostReport.lostReport.LostTotalAmount__c = 0.0;
                }
                if(!this.LostReport.lostReport.InclusionUltrasound__c){
                    this.LostReport.lostReport.InclusionUltrasound__c = '0';
                }
                this.newProduct = JSON.parse(JSON.stringify(this.LostReport.LostBrands[0].LostProducts[0]));
                if(this.newProduct.LostProductss.Id){
                    delete this.newProduct.LostProductss.Id;
                }
                this.newProduct.LostProductss.LostBrandName__c = '';
                this.newProduct.LostProductss.LostProduct__r = '';
                this.newProduct.LostProductss.Quantity__c = '';
                this.newProduct.LostProductss.LostProductMannual__c = '';
                this.newProduct.LostProductss.ProductClass__c = '';
                this.newProduct.LostProductss.ProductCategory__c = '';
                // this.newProduct.LostProductss.Id = '';
                this.newApprovalHistorys = JSON.parse(JSON.stringify(this.LostReport.approvalHistorys));
                console.log(this.LostReport);
                console.log(this.LostReport.approvalHistorys.length);
@@ -177,7 +228,7 @@
                        }else if(this.LostReport.approvalHistorys[i].StepStatus == 'Reassigned'){
    
                        }else if(this.LostReport.approvalHistorys[i].StepStatus == 'Rejected'){
                            resthis.LostReportult.approvalHistorys[i].StepStatus = '已拒绝';
                                this.LostReport.approvalHistorys[i].StepStatus = '已拒绝';
                        }else if(this.LostReport.approvalHistorys[i].StepStatus == 'Removed'){
    
                        }else if(this.LostReport.approvalHistorys[i].StepStatus == 'Started'){
@@ -187,8 +238,21 @@
                        console.log('321');
                    }
                    this.submitFlag = true;
                    if(this.LostReport.lostReport.Report_Status__c == '批准'){
                        this.submitFlag = false;
                    }
                }
                this.isInit = true;
                console.log(PCLReportProfileId.includes(this.userProfileId));
                console.log(PCLReportProfileId);
                console.log(this.userProfileId);
                getUserProfileId().then(result1=>{
                    this.userProfileId = result1;
                    if(this.pageStatus == 'Edit' && !(this.LostReport.lostReport.Report_Status__c == '草案' || this.userProfileId == '00e10000000Y3o5AAC' || (this.LostReport.lostReport.Report_Status__c == '批准' && PCLReportProfileId.includes(this.userProfileId)))){
                        this.status.pageStatus = 'View';
                    }
                    this.isInit = true;
                });
            }
            }).catch(error=>{
                console.log("error");
@@ -209,11 +273,13 @@
            fieldName: 'ProductCategory__c'
        }).then(result=>{
            this.productOptionsList = JSON.parse(result);
            this.LostReport = JSON.parse(JSON.stringify(this.LostReport));
            console.log(this.LostReport.approvalHistorys.length + 'size');
        }).catch(error=>{
            console.log('error');
            console.log(error);
        });
    }
    renderedCallback(){
        const sections = this.template.querySelectorAll('lightning-accordion-section');
@@ -221,7 +287,12 @@
            console.log(section);
            section.active = true;    
        });
        console.log('1');
        console.log(this.LostReport.lostReport.LostTotalAmount__c);
        this.LostReport.lostReport.LostTotalAmount__c = this.LostReport.lostReport.LostTotalAmount__c;
        // this.LostReport = JSON.parse(JSON.stringify(this.LostReport));
    }
    brandTitle = ['失单品牌1','失单品牌2','失单品牌3','失单品牌4','失单品牌5','失单品牌6'];
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
@@ -238,6 +309,33 @@
            }
        }
    }
    closeAction(){
        this.visible = false;
    }
    get haveApprovalHistorys(){
        console.log(this.LostReport.approvalHistorys.length + 'size');
        if(this.LostReport.approvalHistorys.length > 1){
            return true;
        }else{
            return false;
        }
    }
    get isCanSubmit(){
        if(this.LostReport.lostReport.Report_Status__c == '草案' || this.LostReport.lostReport.Report_Status__c == '批准'){
            return true;
        }else{
            return false;
        }
    }
    get isCanEdit(){
        if(this.LostReport.lostReport.Report_Status__c == '草案' || this.userProfileId == '00e10000000Y3o5AAC' || (this.LostReport.lostReport.Report_Status__c == '批准' && PCLReportProfileId.includes(this.userProfileId))){
            return true;
        }else{
            return false;
        }
    }
    showToast(msg,type) {
        try {
@@ -251,9 +349,9 @@
            let delay = 5000;
            console.log(this.message);
            console.log('1');
            setTimeout(() => {
                this.visible = false;
            }, delay );
            // setTimeout(() => {
            //     this.visible = false;
            // }, delay );
        } catch (error) {
            console.log(error);
        }
@@ -311,6 +409,13 @@
        }
        return false;
    }
    get isCaoAn(){
        if(this.LostReport.lostReport.Report_Status__c == '草案'){
            return true;
        }else{
            return false;
        }
    }
    get isEdit(){
        if(this.status.pageStatus == 'Edit'){
@@ -318,6 +423,7 @@
        }
        return false;
    }
    get isSubmit(){
        if(this.submitFlag){
            return true;
@@ -330,6 +436,14 @@
            lineNo: this.LostReport.LostBrands.length
        }).then(result=>{
            this.LostReport.LostBrands.push(result);
            // 获取 lightning-accordion 的 DOM 元素
            setTimeout(() => {
                const accordion = this.template.querySelector('.example-accordion');
            console.log(accordion);
            console.log('1');
            accordion.activeSectionName = this.brandTitle;
            }, 200);
        });
    }
    addRow(event){
@@ -345,8 +459,9 @@
        console.log('1');
        this.IsLoading = true;
        submit({
            report1: JSON.stringify(this.LostReport),
            reportId: this.reportId
            reportStatus: this.LostReport.lostReport.Report_Status__c,
            modifyAfterApproval: this.LostReport.lostReport.ModifyAfterApproval__c,
            reportId: this.LostReport.lostReport.Id
        }).then(result=>{
            if(result.error){
                this.showToast(result.error,"error");
@@ -381,8 +496,12 @@
                }
                this.submitFlag = JSON.parse(JSON.stringify(result.submitFlag));
                console.log(this.LostReport);
                this.updateRecordView(this.reportId);
                this.LostReport.lostReport.Report_Status__c = '申请中';
                // this.updateRecordView(this.reportId);
                this.showToast('提交成功!','success');
                setTimeout(() => {
                    window.location = '/' + this.LostReport.lostReport.Id;
                }, 2000);
            }
            this.IsLoading = false;
        }).catch(error=>{
@@ -391,14 +510,19 @@
        });
    }
    onApproveChange(event){
        window.open('/lightning/r/ProcessInstanceStep/'+ this.LostReport.approvalHistorys[0].Id + '/view?0.source=alohaHeader');
        // this[NavigationMixin.Navigate]({
        //     type: 'standard__recordPage',
        //     attributes: {
        //         recordId: this.LostReport.approvalHistorys[0].Id,
        //         actionName: 'view'
        //     }
        // });
        // var approvalId;
        // for(var i=0;i < this.LostReport.approvalHistorys.length;i++){
        //     if(this.LostReport.approvalHistorys[i].StepStatus == '待处理'){
        //         approvalId = this.LostReport.approvalHistorys[i].Id;
        //     }
        // }
        // window.open('/lightning/r/ProcessInstanceStep/'+ approvalId + '/view?0.source=alohaHeader');
        this.isPop = true;
    }
    onApproveChange1(){
        window.open('/lightning/r/' + this.LostReport.lostReport.Id + '/related/ProcessSteps/view?0.source=alohaHeader');
    }
    
@@ -439,6 +563,8 @@
        this.LostReport.LostBrands[index].lostBrand.Lost_By_Company__c = payload.value;
        this.LostReport.LostBrands[index].lostBrand.Lost_reason_main__c = '';
        this.LostReport.LostBrands[index].lostBrand.Lost_Reason_Sub__c = '';
        this.LostReport.LostBrands[index].lostBrand.ChannelSpecificReasons__c = '';
        this.LostReport.LostBrands[index].reasonFlag = false;
        searchBatchIfForProduct({
            productName: this.LostReport.LostBrands[index].lostBrand.Lost_By_Company__c
        }).then(result=>{
@@ -454,6 +580,7 @@
                this.setDefaultBrand(payload.value,index);
                this.clearBrandMannualName(payload.value,index);
            }
            console.log('cnm:' + JSON.stringify(this.LostReport));
        });
        
    }
@@ -514,8 +641,30 @@
        //         actionName: 'view'
        //     }
        // });
        window.location = '/' +this.oppId;
        window.location = '/lightning/r/Opportunity/' + this.LostReport.lostReport.Opportunity__c + '/view';
    }
    removeFieldsWithR(obj) {
        if (Array.isArray(obj)) {
            // 如果属性是数组,遍历数组元素
            for (var i = 0; i < obj.length; i++) {
                // 递归调用函数处理数组元素
                this.removeFieldsWithR(obj[i]);
            }
        } else if (typeof obj === 'object' && obj !== null) {
            // 如果属性是对象,则遍历对象属性
            for (var key in obj) {
                if (key.includes('__r') || key === 'approvalHistorys') {
                    // 如果属性名以 '__r' 结尾,删除它
                    console.log(key);
                    delete obj[key];
                }else if (typeof obj[key] === 'object' && obj[key] !== null) {
                    // 如果属性是对象,则递归调用该函数
                    this.removeFieldsWithR(obj[key]);
                }
            }
        }
    }
    
    saveBrandJs(event) {
        this.IsLoading = true;
@@ -525,10 +674,13 @@
            return;
        }
        console.log(this.LostReport);
        var newLostReport = JSON.parse(JSON.stringify(this.LostReport));
        newLostReport.approvalHistorys = this.newApprovalHistorys;
        this.newReport = JSON.parse(JSON.stringify(this.LostReport));
        this.newReport.approvalHistorys = this.newApprovalHistorys;
        console.log(JSON.stringify(this.newReport));
        this.removeFieldsWithR(this.newReport);
        console.log(JSON.stringify(this.newReport));
        dataEntry({
            report1 : JSON.stringify(newLostReport),
            report1 : JSON.stringify(this.newReport),
            deleteBrandIdList: this.deleteBrandIdList,
            deleteProductIdList: this.deleteProductIdList
        }).then(result=>{
@@ -685,7 +837,8 @@
    removeRow(event){
        var index1 = event.target.name;
        var index2 = event.target.value;
        var deleteButtons = this.template.querySelectorAll('.deleteButton[data-id="' + index1 + '"]');
        var deleteButtons = this.template.querySelectorAll('.iconButton[data-id="' + index1 + '"]');
        console.log(deleteButtons.length + ' chen1');
        if(deleteButtons.length == 1){
            return;
        }
@@ -720,7 +873,13 @@
                    elements1[secondNum].readOnly = false;
                    elements2[secondNum].readOnly = false;
                    this.LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductClass__c=prd.ProductClass__c;
                    this.LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductCategory__c=prd.ProductCategory__c;
                    console.log(prd.ProductClass__c + '  ' + prd.ProductCategory__c);
                    if(prd.ProductClass__c == '其他' && (prd.ProductCategory__c == '' || prd.ProductCategory__c == null || prd.ProductCategory__c == undefined)){
                        this.LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductCategory__c = '其他';
                    }else{
                        this.LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductCategory__c=prd.ProductCategory__c;
                    }
                    elements1[secondNum].readOnly = true;
                    elements2[secondNum].readOnly = true;
                }else {
@@ -728,7 +887,7 @@
                    elements2[secondNum].readOnly = false;
                    this.LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductClass__c=null;
                    this.LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductCategory__c=null;
                    elements1[secondNum].readOnly = true;
                    // elements1[secondNum].readOnly = true;
                    elements2[secondNum].readOnly = true;
                }
            }).catch(error=>{
@@ -737,6 +896,84 @@
            });
            
        }
    }
    handleModalCancel(){
        this.isPop = false;
    }
    handleModalSubmit(){
        this.IsLoading = true;
        const comment = this.template.querySelector('.comment');
        console.log(this.isLookup == true && this.newActorId == null);
        if(this.isLookup == true && this.newActorId == null){
            this.showToast('请填入新分配人','error');
            this.IsLoading = false;
            return;
        }
        this.isPop = false;
        if(this.newActorId){
            reassignStep({
                recordId: this.LostReport.lostReport.Id,
                newActorId: this.newActorId
            }).then(result=>{
                if(result){
                    this.showToast('您无权重新分配','error');
                    this.IsLoading = false;
                }else{
                    window.location = '/' + this.LostReport.lostReport.Id;
                }
            });
        }else{
            submitForApproval({
                recordId: this.LostReport.lostReport.Id,
                comments: comment.value,
                action: this.action
            }).then(result=>{
                if(result){
                    if(this.action == 'Approve'){
                        this.showToast('您无权批准','error');
                    }else if(this.action == 'Reject'){
                        this.showToast('您无权拒绝','error');
                    }else if(this.action == 'Removed'){
                        this.showToast('您无权撤回','error');
                    }
                    this.IsLoading = false;
                }else{
                    window.location = '/' + this.LostReport.lostReport.Id;
                }
            });
        }
    }
    handleSubmitApp(){
        this.modalsubmitLabel = '批准';
        this.isPop = true;
        this.action = 'Approve';
        this.isLookup = false;
        this.newActorId = null;
    }
    handleReStartApp(){
        this.modalsubmitLabel = '重新分配';
        this.isPop = true;
        this.isLookup = true;
    }
    handleNoApp(){
        this.modalsubmitLabel = '拒绝';
        this.isPop = true;
        this.action = 'Reject';
        this.isLookup = false;
        this.newActorId = null;
    }
    handleCancelApp(){
        this.modalsubmitLabel = '撤回';
        this.isPop = true;
        this.action = 'Removed';
        this.isLookup = false;
        this.newActorId = null;
    }
    handleClear(event){
@@ -758,7 +995,8 @@
    }
    handleChannelSpecificReasonChange(event){
        var value = event.target.value;
        this.LostReport.lostReport.LostType__c = value;
        var index = event.target.name;
        this.LostReport.LostBrands[index].lostBrand.ChannelSpecificReasons__c = value;
    }
    
    handleLostReasonMainChange(event){
@@ -766,7 +1004,10 @@
        var value = event.target.value;
        this.LostReport.LostBrands[index].lostBrand.Lost_reason_main__c = value;
        if(value == '渠道因素'){
            this.LostReport.LostBrands[index].reasonFlag = true;
        }else if(this.LostReport.LostBrands[index].lostBrand.Lost_reason_main__c != '渠道因素' && this.LostReport.LostBrands[index].lostBrand.Lost_Reason_Sub__c != '渠道因素'){
            this.LostReport.LostBrands[index].reasonFlag = false;
            this.LostReport.LostBrands[index].lostBrand.ChannelSpecificReasons__c = '';
        }
    }
@@ -774,6 +1015,12 @@
        var index = event.target.name;
        var value = event.target.value;
        this.LostReport.LostBrands[index].lostBrand.Lost_Reason_Sub__c = value;
        if(value == '渠道因素'){
            this.LostReport.LostBrands[index].reasonFlag = true;
        }else if(this.LostReport.LostBrands[index].lostBrand.Lost_reason_main__c != '渠道因素' && this.LostReport.LostBrands[index].lostBrand.Lost_Reason_Sub__c != '渠道因素'){
            this.LostReport.LostBrands[index].reasonFlag = false;
            this.LostReport.LostBrands[index].lostBrand.ChannelSpecificReasons__c = '';
        }
    }
    handleLostByCompanyMannualChange(event){
@@ -845,6 +1092,9 @@
        }
       
    }
    handleActorChange(event){
        this.newActorId = event.target.value;
    }
    handleProductCategoryChange(event){
        var index1 = event.target.title;
force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.css
@@ -1,4 +1,4 @@
.predictedDateChangeHolder{
/* .predictedDateChangeHolder{
    position: relative;
    display: inline-block;
    width: 80px;
@@ -7,4 +7,11 @@
}
.container .uiContainerManager{
    display: none !important;
}
} */
.custom-date-input .slds-datepicker {
    /* 设置日期选择器的宽度 */
    width: 300px; /* 根据需要调整宽度 */
    /* 设置日期选择器的高度 */
    height: 300px; /* 根据需要调整高度 */
    /* 设置其他样式属性,如字体大小、边框、边框圆角等 */
  }
force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.html
@@ -1,6 +1,17 @@
<!--
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-09-09 13:27:59
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-27 13:38:02
-->
<template>
    <div class="predictedDateChangeHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
    </div>
            <div if:true={flag}>
                <div>
                    <c-improved-forecast-time oncloseaction={handleChildEvent} record-id ={recordId}></c-improved-forecast-time>
                </div>
            </div>
</template>
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-09-12 13:35:56
 * @LastEditTime: 2023-09-20 17:28:12
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -13,11 +13,16 @@
import init  from '@salesforce/apex/OpportunityLightingButtonController.initForPredictedDateChangeButton';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
import lexInputCSS from '@salesforce/resourceUrl/lexInputCSS';
export default class LexPredictedDateChange extends LightningElement {
    @api recordId;
    IsLoading = true;
    directLossFLG;
    createdDay;
    flag = false;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
            console.log(111);
@@ -35,17 +40,23 @@
    }
    showToast(msg,type) {
      const event = new ShowToastEvent({
          title: ' ',
          message: msg,
          variant: type,
          mode: 'sticky'
      });
      this.dispatchEvent(event);
        title: ' ',
        message: msg,
        variant: type,
        mode: 'sticky'
    });
    this.dispatchEvent(event);
    }
    updateRecordView(recordId) {
      updateRecord({fields: { Id: recordId }});
    }
    connectedCallback(){
      Promise.all([
        loadStyle(this, lwcCSS),
        loadStyle(this, lexInputCSS)
       ]);
      init({
        recordId: this.recordId
      }).then(result=>{
@@ -56,6 +67,10 @@
        console.log("error");
        console.log(error);
      })
    }
    handleChildEvent(){
      console.log('close');
      this.dispatchEvent(new CloseActionScreenEvent());
    }
    predictedDateChange(){
      // 20221206 ljh DB202212030068 start
@@ -77,8 +92,9 @@
          this.dispatchEvent(new CloseActionScreenEvent());
          return;
        } else {
          window.open('/apex/ImprovedForecastTime?id=' + this.recordId,'','height=500,width=800,top=200,left=250,location=no');
          this.dispatchEvent(new CloseActionScreenEvent());
          this.flag = true;
          // window.open('/apex/ImprovedForecastTimeAno?id=' + this.recordId,'','height=500,width=800,top=200,left=250,location=no');
          // this.dispatchEvent(new CloseActionScreenEvent());
        }
      })
    }
force-app/main/default/lwc/lexQuotationProductNew/lexQuotationProductNew.html
@@ -1,6 +1,6 @@
<template>
    <div class="lexQuotationRequestHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
    </div>
</template>
force-app/main/default/lwc/lexQuotationRequest/lexQuotationRequest.css
@@ -1,4 +1,4 @@
.lexQuotationRequestHolder{
/* .lexQuotationRequestHolder{
    position: relative;
    display: inline-block;
    width: 80px;
@@ -7,4 +7,4 @@
}
.container .uiContainerManager{
    display: none !important;
}
} */
force-app/main/default/lwc/lexQuotationRequest/lexQuotationRequest.html
@@ -4,11 +4,11 @@
 * @Author: chen jing wu
 * @Date: 2023-04-14 11:09:28
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-04-14 11:10:38
 * @LastEditTime: 2023-09-23 12:29:03
-->
<template>
    <div class="lexQuotationRequestHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
    </div>
</template>
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-09-11 16:56:06
 * @LastEditTime: 2023-09-14 16:42:54
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -13,7 +13,8 @@
import init  from '@salesforce/apex/OpportunityLightingButtonController.initForQuotationRequestButton';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexQuotationRequest extends LightningElement {
    @api recordId;
    biddingProjectNameBidId;
@@ -34,6 +35,9 @@
        }
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
force-app/main/default/lwc/lexRequestDB/lexRequestDB.css
@@ -1,4 +1,4 @@
.lexRequestDBHolder{
/* .lexRequestDBHolder{
    position: relative;
    display: inline-block;
    width: 80px;
@@ -7,4 +7,4 @@
}
.container .uiContainerManager{
    display: none !important;
}
} */
force-app/main/default/lwc/lexRequestDB/lexRequestDB.html
@@ -1,6 +1,14 @@
<!--
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-09-09 13:27:59
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-23 12:29:23
-->
<template>
    <div class="lexRequestDBHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
    </div>
</template>
force-app/main/default/lwc/lexRequestDB/lexRequestDB.js
@@ -6,6 +6,8 @@
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexRequestDB extends NavigationMixin(LightningElement) {
    @api recordId;
    stageName;
@@ -39,6 +41,9 @@
        }
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
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-09-11 13:52:37
 * @LastEditTime: 2023-09-14 16:43:46
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -14,6 +14,8 @@
import { updateRecord } from 'lightning/uiRecordApi';
import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexSIStoOPD extends LightningElement {
    @api recordId;
    IsLoading = true;
@@ -38,6 +40,10 @@
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        console.log(this.recordId);
        init({
            recordId: this.recordId
force-app/main/default/lwc/lexSpecSubmit/lexSpecSubmit.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-06-06 15:41:32
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-01 09:33:28
 * @LastEditTime: 2023-09-14 16:45:42
 */
import { api, wire,LightningElement, track } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -16,6 +16,8 @@
import LightningConfirm from 'lightning/confirm';
import STATUS_FIELD from "@salesforce/schema/OpportunitySpecialApply__c.Status__c";
import { refreshApex } from '@salesforce/apex';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexSpecSubmit extends LightningElement {
    @wire(getRecord, { recordId: '$recordId', fields: [STATUS_FIELD] })
    record;
@@ -55,6 +57,9 @@
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-06-25 10:54:07
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-07-07 11:22:38
 * @LastEditTime: 2023-09-14 16:44:06
 */
import { LightningElement,api, track, wire } from 'lwc';
import {CurrentPageReference} from 'lightning/navigation';
@@ -13,7 +13,8 @@
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import init from '@salesforce/apex/OpportunityLightingButtonController.initForSpecilaApplyCreateAchButton';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexSpecilaApplyCreateAch extends NavigationMixin(LightningElement) {
    @api achId;
    oppId;
@@ -35,6 +36,9 @@
        }
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.achId
        }).then(result=>{
force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.js
@@ -5,7 +5,8 @@
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import init from '@salesforce/apex/OpportunityLightingButtonController.initForSpecilaApplyCreateButton';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexSpecilaApplyCreateLwc extends NavigationMixin(LightningElement) {
    @api oppId;
    oppName;
@@ -28,6 +29,9 @@
        }
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.oppId
        }).then(result=>{
force-app/main/default/lwc/lexStockApply/lexStockApply.css
@@ -1,4 +1,4 @@
.lexStockApplyHolder{
/* .lexStockApplyHolder{
    position: relative;
    display: inline-block;
    width: 80px;
@@ -7,4 +7,4 @@
}
.container .uiContainerManager{
    display: none !important;
}
} */
force-app/main/default/lwc/lexStockApply/lexStockApply.html
@@ -1,7 +1,14 @@
<!--
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-09-09 13:27:59
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-23 12:29:43
-->
<template>
    <div class="lexStockApplyHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
        <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button>
    </div>
</template>
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-09-11 16:58:40
 * @LastEditTime: 2023-09-14 16:46:11
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -17,6 +17,8 @@
import connection from '@salesforce/resourceUrl/connection20';
import submitProcess  from '@salesforce/apex/OpportunityLightingButtonController.submitProcess';
import LightningConfirm from 'lightning/confirm';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexStockApply extends LightningElement {
    @api recordId;
    stockApplyStatus;
@@ -101,6 +103,9 @@
        }
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
force-app/main/default/lwc/lexSubmitCompetitorReport/lexSubmitCompetitorReport.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-04-07 09:02:03
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-08-25 16:50:36
 * @LastEditTime: 2023-09-14 16:46:40
 */
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -14,6 +14,8 @@
import { updateRecord } from 'lightning/uiRecordApi';
import init  from '@salesforce/apex/ReportController.initForSubmitCompetitorReportButton';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexSubmitCompetitorReport extends LightningElement {
    @api recordId;
    IsLoading = true;
@@ -39,6 +41,9 @@
  }
    connectedCallback(){
      Promise.all([
        loadStyle(this, lwcCSS)
       ]);
          init({
            recordId: this.recordId
          }).then(result=>{
force-app/main/default/lwc/lexSubmitReport/lexSubmitReport.css
@@ -1,4 +1,4 @@
.specSubmitHolder{
/* .specSubmitHolder{
    position: relative;
    display: inline-block;
    width: 80px;
@@ -7,4 +7,4 @@
}
.container .uiContainerManager{
    display: none !important;
}
} */
force-app/main/default/lwc/lexSubmitReport/lexSubmitReport.html
@@ -1,5 +1,13 @@
<!--
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-09-11 09:20:29
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-26 09:31:46
-->
<template>
    <div class="specSubmitHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="small"></lightning-spinner>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexSubmitReport/lexSubmitReport.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-09-11 09:20:29
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-11 10:00:40
 * @LastEditTime: 2023-09-26 09:32:55
 */
import { api, wire,LightningElement, track } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -16,14 +16,15 @@
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 LexSubmitReport extends LightningElement {
    @wire(getRecord, { recordId: '$recordId', fields: [STATUS_FIELD] })
    record;
    @api recordId;
    cntLostCancelReport;
    cntLostCancelDraft;
    IsLoading = true;
    IsLoading;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
            console.log(111);
@@ -55,6 +56,9 @@
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
@@ -80,6 +84,7 @@
            label: 'this is the aria-label value'
        });
        console.log(result);
        this.IsLoading = true;
        if(result){
            updateSubmitReportButton({
                recordId: this.recordId
@@ -89,9 +94,9 @@
                }else{
                    setTimeout(() => {
                        this.IsLoading = false;
                        refreshApex(this.record);
                        window.location = '/' + this.recordId;
                        this.dispatchEvent(new CloseActionScreenEvent());
                    }, 2000);
                    }, 1000);
                }
            });
        }else{
force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.js
@@ -8,7 +8,8 @@
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import LightningConfirm from 'lightning/confirm';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexSubmitSolutionSchemeForApproval extends LightningElement {
    @api recordId;
    schemeType;
@@ -35,6 +36,9 @@
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
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-09-11 15:39:09
 * @LastEditTime: 2023-09-14 16:47:51
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -13,6 +13,8 @@
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import LightningConfirm from 'lightning/confirm';
import updateOpportunity from '@salesforce/apex/OCMManagementProvinceWebService.updateOpportunity';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexUpdateToOpp extends LightningElement {
    showToast(msg,type) {
        const event = new ShowToastEvent({
@@ -24,6 +26,9 @@
        this.dispatchEvent(event);
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        this.handleConfirmClick('是否将OCSM管理省的担当者信息反映到关联询价?');
    }
    async handleConfirmClick(msg) {
force-app/main/default/lwc/lexVOCAnswer/lexVOCAnswer.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-03-27 14:05:59
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-08-25 16:51:56
 * @LastEditTime: 2023-09-14 16:48:12
 */
import { LightningElement, wire, track, api } from "lwc";
import { CurrentPageReference } from "lightning/navigation";
@@ -14,6 +14,8 @@
import updateForVOCAnswerButton from "@salesforce/apex/ReportController.updateForVOCAnswerButton";
import { updateRecord } from "lightning/uiRecordApi";
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexVOCAnswer extends LightningElement {
  @api recordId;
  status;
@@ -36,6 +38,9 @@
  }
  connectedCallback() {
    Promise.all([
      loadStyle(this, lwcCSS)
     ]);
    console.log(this.recordId);
    init({
      recordId: this.recordId,
force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js
@@ -8,6 +8,8 @@
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import getUserIdByName from '@salesforce/apex/ReportController.getUserIdByName';
import getProfileIdByName from '@salesforce/apex/ReportController.getProfileIdByName';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexVOCCheck extends LightningElement {
    
    @api recordId;
@@ -39,6 +41,9 @@
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        console.log(this.recordId);
        init({
            recordId: this.recordId
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-09-11 13:48:56
 * @LastEditTime: 2023-09-14 16:49:02
 */
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -14,6 +14,8 @@
import  updateForVOCConfirmButton from '@salesforce/apex/ReportController.updateForVOCConfirmButton';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexVOCConfirm extends LightningElement {
    @api recordId;
    status;
@@ -39,6 +41,9 @@
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        console.log(this.recordId);
        init({
            recordId: this.recordId
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-09-11 13:49:03
 * @LastEditTime: 2023-09-14 16:49:23
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -13,6 +13,8 @@
import update  from '@salesforce/apex/ReportController.updateForVOCFinishButton';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexVOCFinish extends LightningElement {
    @api recordId;
    status;
@@ -40,6 +42,9 @@
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        console.log(this.recordId);
        init({
            recordId: this.recordId
force-app/main/default/lwc/lexVOCSubmit/lexVOCSubmit.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-03-27 13:39:23
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-08 15:42:21
 * @LastEditTime: 2023-09-14 16:49:45
 */
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -14,6 +14,8 @@
import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexVOCSubmit extends LightningElement {
    @api recordId;
    createdById;
@@ -37,6 +39,9 @@
    }
    
    connectedCallback () {
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        console.log(this.recordId);
        init({
            recordId: this.recordId
force-app/main/default/lwc/modal/modal.css
New file
@@ -0,0 +1,3 @@
.modal-hidden {
    display: none;
  }
force-app/main/default/lwc/modal/modal.html
New file
@@ -0,0 +1,47 @@
<template>
    <template if:true={showModal}>
      <section
        role="dialog"
        tabindex="-1"
        aria-labelledby="modal-heading-01"
        aria-modal="true"
        aria-describedby="modal-content-id-1"
        class="slds-modal slds-fade-in-open"
      >
        <div class="slds-modal__container">
          <header class="slds-modal__header">
            <lightning-button-icon
              class="slds-modal__close"
              title="Close"
              icon-name="utility:close"
              icon-class="slds-button_icon-inverse"
              onclick={handleDialogClose}
            ></lightning-button-icon>
            <template if:true={hasHeaderString}>
              <h2 class="slds-text-heading_medium slds-hyphenate header-string">
                {header}
              </h2>
            </template>
            <template if:false={hasHeaderString}>
              <h2 class="slds-text-heading_medium slds-hyphenate header-slot">
                <slot name="header"></slot>
              </h2>
            </template>
            <p class="slds-m-top_x-small modal-hidden">
              <slot name="tagline" onslotchange={handleSlotTaglineChange}></slot>
            </p>
          </header>
          <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
            <slot></slot>
          </div>
          <footer class="slds-modal__footer modal-hidden">
            <slot name="footer" onslotchange={handleSlotFooterChange}></slot>
          </footer>
        </div>
      </section>
      <div class="slds-backdrop slds-backdrop_open"></div>
    </template>
  </template>
force-app/main/default/lwc/modal/modal.js
New file
@@ -0,0 +1,46 @@
import { LightningElement, api, track } from "lwc";
const CSS_CLASS = "modal-hidden";
export default class Modal extends LightningElement {
  @track showModal = false;
  @api objName;
  @api
  set header(value) {
    this.hasHeaderString = value !== "";
    this._headerPrivate = value;
  }
  get header() {
    return this._headerPrivate;
  }
  @track hasHeaderString = false;
  _headerPrivate;
  @api show() {
    this.showModal = true;
    console.log('show!!!!!!!!');
    console.log(this.objName);
  }
  @api hide() {
    this.showModal = false;
  }
  handleDialogClose() {
    //Let parent know that dialog is closed (mainly by that cross button) so it can set proper variables if needed
    const closedialog = new CustomEvent("closedialog");
    this.dispatchEvent(closedialog);
    this.hide();
  }
  handleSlotTaglineChange() {
    const taglineEl = this.template.querySelector("p");
    if (taglineEl && taglineEl.classList) taglineEl.classList.remove(CSS_CLASS);
  }
  handleSlotFooterChange() {
    const footerEl = this.template.querySelector("footer");
    if (footerEl && footerEl.classList) footerEl.classList.remove(CSS_CLASS);
  }
}
force-app/main/default/lwc/modal/modal.js-meta.xml
New file
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?>
<LightningComponentBundle
  xmlns="http://soap.sforce.com/2006/04/metadata"
  fqn="modal"
>
    <apiVersion>48.0</apiVersion>
    <isExposed>false</isExposed>
    <targets>
      <target>lightning__RecordPage</target>
      <target>lightning__AppPage</target>
      <target>lightning__HomePage</target>
      <target>lightning__RecordAction</target>
    </targets>
    <targetConfigs>
      <targetConfig targets="lightning__RecordPage">
       <supportedFormFactors>
          <supportedFormFactor type="Small" />
          <supportedFormFactor type="Large" />
      </supportedFormFactors>
      </targetConfig>
    </targetConfigs>
</LightningComponentBundle>
force-app/main/default/lwc/multiSelectCombobox/multiSelectCombobox.html
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-04-25 17:41:26
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-08-01 16:34:11
 * @LastEditTime: 2023-09-27 17:36:59
-->
<!-- Code by CafeForce || www.cafeforce.com || support@cafeforce.com || Mandatory Header -->
@@ -16,25 +16,28 @@
            <span style="color:red;font-size: 10px;">*</span>
            {label}</label>
    </template>
    <div class="slds-combobox_container">
    <div data-id="myinput" class="slds-combobox_container">
        <div class="slds-combobox slds-dropdown-trigger slds-dropdown-trigger_click slds-is-open" aria-expanded="true" aria-haspopup="listbox" role="combobox">
            <!-- Search Input -->
            <div class="slds-combobox__form-element slds-input-has-icon slds-input-has-icon_right" role="none">
                <lightning-input data-id="myinput" disabled={disabled} class="inputBox" placeholder={placeholder} onblur={blurEvent} onclick={showOptions} onkeyup={filterOptions} value={searchString} auto-complete="off" variant="label-hidden" id="combobox-id-1" required={isRequired}></lightning-input>
                <lightning-icon class="slds-input__icon" icon-name="utility:down" size="x-small" alternative-text="search"></lightning-icon>
                <lightning-input data-id="myinput" disabled={disabled} class="inputBox" placeholder={placeholder} onblur={blurEvent} onclick={showOptions} onkeyup={filterOptions} value={searchString} auto-complete="off" variant="label-hidden" id="combobox-id-1"></lightning-input>
                <lightning-icon class="slds-input__icon slds-input__icon_right slds-icon-utility-down slds-icon_container" icon-name="utility:down" size="x-small" alternative-text="search"></lightning-icon>
            </div>
            <!-- Dropdown List -->
            <template if:true={showDropdown}>
                <div id="listbox-id-1" class="slds-dropdown slds-dropdown_length-5 slds-dropdown_fluid"><!--style="{! 'max-height:' + (8 + (v.recordCount * 40)) + 'px' }""-->
                <div id="listbox-id-1" class="slds-dropdown slds-dropdown_length-5 slds-dropdown_fluid"  role="listbox"><!--style="{! 'max-height:' + (8 + (v.recordCount * 40)) + 'px' }""-->
                    <ul class="slds-listbox slds-listbox_vertical recordListBox" role="presentation">
                        <template if:false={message} >
                            <template for:each={optionData} for:item="option">
                                <template if:true={option.isVisible}>
                                    <li key={option.value} data-id={option.value} onmousedown={selectItem} class="slds-listbox__item eachItem">
                                        <template if:true={option.selected}>
                                            <lightning-icon icon-name="utility:check" size="x-small" alternative-text="icon" ></lightning-icon>
                                        </template>
                                        <span class="slds-media slds-listbox__option_entity verticalAlign slds-truncate">{option.label}</span>
                                        <div id="option724" class="slds-media slds-listbox__option slds-listbox__option_plain slds-media_small" role="option">
                                            <template if:true={option.selected}>
                                                <lightning-icon icon-name="utility:check" size="x-small" alternative-text="icon" ></lightning-icon>
                                            </template>
                                            <span class="slds-media slds-listbox__option_entity verticalAlign slds-truncate">{option.label}</span>
                                        </div>
                                    </li>
                                </template>
                            </template>
@@ -49,6 +52,9 @@
            </template>
        </div>
    </div>
    <template if:true={errorFlag}>
        <div style="color:#EA001E;font-size:10px">填写此字段。</div>
    </template>
    <!-- Multi Select Pills -->
    <template for:each={optionData} for:item="option">
        <template if:true={option.selected}>
force-app/main/default/lwc/multiSelectCombobox/multiSelectCombobox.js
@@ -19,6 +19,7 @@
    @track message;
    @track showDropdown = false;
    @api placeholder = '--无--';
    @track errorFlag = false;
    connectedCallback() {
        this.showDropdown = false;
        var optionData = this.options ? (JSON.parse(JSON.stringify(this.options))) : null;
@@ -159,6 +160,17 @@
                count++;
            }
        }
        if(!previousLabel){
            var element = this.template.querySelector('[data-id="myinput"]');
            element.classList.add('slds-has-error');
            this.errorFlag = true;
            this.showDropdown = false;
        }else{
            var element = this.template.querySelector('[data-id="myinput"]');
            element.classList.remove('slds-has-error');
            this.errorFlag = false;
            this.showDropdown = false;
        }
        if(this.multiSelect)
            this.searchString = count + ' Option(s) Selected';
        else
force-app/main/default/lwc/tEnquiry/tEnquiry.html
@@ -1,38 +1,74 @@
<!--
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-09-09 13:28:00
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-23 12:14:01
-->
<template>
  <!-- <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> -->
  <!-- 成功 -->
  <div>
      <!-- 成功 -->
      <div style="float:right" >
        <div class="demo-only demo-only_viewport" style="height:4.5rem;" if:true = {Tongzhishow}>
          <div class="slds-notification-container" style={IsLeftStyle} >
            <div aria-live="assertive" aria-atomic="true" class="slds-assistive-text">提示</div>
            <section class="slds-notification" role="dialog" aria-labelledby="noti77" aria-describedby="dialog-body-id-43">
              <div class="slds-notification__body" id="dialog-body-id-43">
                <a class="slds-notification__target slds-media" href="#" style={BgColorStyle}>
                  <span class="slds-icon_container slds-icon-standard-task slds-media__figure" title="task">
                      <lightning-icon icon-name={TongzhiIcon} alternative-text="Account" title="Account"></lightning-icon>
                  </span>
                  <div class="slds-media__body">
                    <h2 class="slds-text-heading_small slds-m-bottom_xx-small" id="noti77">
                      <span class="slds-assistive-text">task notification:</span>提示</h2>
                    <p>{SaveShowText}</p>
                  </div>
                </a>
                <button class="slds-button slds-button_icon slds-button_icon-container slds-notification__close" title="close">
                    <lightning-icon icon-name="utility:close" alternative-text="close" title="close"  size="x-small" onclick={CloseAlert}></lightning-icon>
                </button>
  </div>
  <div>
    <template if:true={visible}>
      <template if:true={isSuccess}>
          <div class="slds-notify_container slds-is-relative" style="position:absolute;top:1rem;left:1rem;right:1rem;position: fixed;z-index: 9999;">
              <div class="slds-notify slds-notify_toast slds-theme_success" role="status">
                  <lightning-icon class="white" icon-name="utility:success" alternative-text="success"  variant="inverse" size="small" ></lightning-icon>
                <div class="slds-notify__content"  style="padding-left: 20px;">
                  <h2 style="color:white;font-size:large">{message}</h2>
                </div>
                <div class="slds-notify__close">
                  <lightning-button-icon icon-name="utility:close"  variant="bare-inverse" size="large" onclick={closeAction}></lightning-button-icon>
                </div>
              </div>
            </section>
          </div>
        </div>
        </div>
    <div class="exampleHolder" if:true={IsLoading}>
      <lightning-spinner alternative-text="Loading" size="large"></lightning-spinner>
    </div>
    <div  style="height:600px;overflow:scroll;">
      <div style="display:inline">
        <!-- <div style="width:200px;float: left" >
            </div>
          <!-- <div style="position:absolute;top:1rem;left:1rem;right:1rem;position: fixed;z-index: 9999;">
              <div class="slds-notify_container slds-is-relative">
                  <div class="slds-notify slds-notify_toast slds-theme_default slds-box slds-box_small"  style="background-color:rgb(46, 132, 74);" role="success">
                  <div class="slds-align_absolute-center">
                  </div>
                  </div>
              </div>
          </div> -->
      </template>
      <template if:false={isSuccess}>
          <!-- <div style="position:absolute;top:1rem;left:1rem;right:1rem;position: fixed;z-index: 9999;">
              <div class="slds-notify_container slds-is-relative">
                  <div class="slds-notify slds-notify_toast slds-theme_default slds-box slds-box_small"  style="background-color:rgb(234, 0, 30);" role="success">
                  <div class="slds-align_right">
                  </div>
                  </div>
              </div>
          </div> -->
          <div class="slds-notify_container slds-is-relative" style="position:absolute;top:1rem;left:1rem;right:1rem;position: fixed;z-index: 9999;">
              <div class="slds-notify slds-notify_toast slds-theme_error" role="status">
                  <lightning-icon class="white" icon-name="utility:error"  size="small" variant="inverse"></lightning-icon>
                <div class="slds-notify__content" style="padding-left: 20px;">
                  <h2 style="color:white;font-size:large">{message}</h2>
                </div>
                <div class="slds-notify__close">
                  <lightning-button-icon icon-name="utility:close" variant="bare-inverse" size="large" onclick={closeAction}></lightning-button-icon>
                </div>
              </div>
            </div>
      </template>
  </template>
  </div>
  <div class="exampleHolder" if:true={IsLoading}>
    <lightning-spinner alternative-text="Loading" size="large"></lightning-spinner>
  </div>
  <div style="height:600px;overflow:scroll;">
    <div style="display:inline">
      <!-- <div style="width:200px;float: left" >
          <label class="slds-form-element__label" for="select-02">询价编码:</label>
          <div class="slds-form-element__control">
            <input type="text" style="width:200px" id="text-input-id-1" placeholder="请输入询价编码" required="" onchange={handleXJBMFn}  aria-describedby="error-message-unique-id" class="slds-input" aria-invalid="true"  />
@@ -41,22 +77,25 @@
        </div> -->
        <div style="width: 500px;float: left;margin-left: 10px;">
          <!-- <div style="width: 450px;float: left;margin-left: 10px;"> -->
          <!-- <c-jzlookupv3  data-parent-id="lookup1" label="关联医院" placeholder="请选择关联医院.."  onsearchchange={onsearchchange} searchdata={searchdata} option={option} onselected={selectedFn}>  </c-jzlookupv3> -->
      <div style="width: 500px;float: left;margin-left: 10px;">
        <!-- <div style="width: 450px;float: left;margin-left: 10px;"> -->
        <!-- <c-jzlookupv3  data-parent-id="lookup1" label="关联医院" placeholder="请选择关联医院.."  onsearchchange={onsearchchange} searchdata={searchdata} option={option} onselected={selectedFn}>  </c-jzlookupv3> -->
          <c-jzlookuplightning   data-parent-id="lookup1"  onsearchchange={onsearchchange1} objectname="Tender_information__c" fieldname="Hospital__c"  >   </c-jzlookuplightning>
        </div>
        <c-jzlookuplightning data-parent-id="lookup1" onsearchchange={onsearchchange1}
          objectname="Tender_information__c" fieldname="Hospital__c"> </c-jzlookuplightning>
      </div>
       <button style="margin-top:24px" class="slds-button slds-button_brand" onclick={SearchFn}>检索</button>
      <button style="margin-top:24px" class="slds-button slds-button_brand" onclick={SaveFn}>保存</button>
      <c-jz-table data-parent-id="table1" selecttitle={selecttitle} notselecttitle={notselecttitle} selectdata={selectdata} isselectedtable={isselectedtable} optionsdata={optionsdata} notselectdata={notselectdata} ondatachange={datachange} onselectedchange={selectedchange} onurlclick={urlClickFn}> </c-jz-table>
    </div>
    <button style="margin-top:24px" class="slds-button slds-button_brand" onclick={SearchFn}>检索</button>
    <button style="margin-top:24px" class="slds-button slds-button_brand" onclick={SaveFn}>保存</button>
    <c-jz-table data-parent-id="table1" selecttitle={selecttitle} notselecttitle={notselecttitle}
      selectdata={selectdata} isselectedtable={isselectedtable} optionsdata={optionsdata} notselectdata={notselectdata}
      ondatachange={datachange} onselectedchange={selectedchange} onurlclick={urlClickFn}> </c-jz-table>
  </div>
</template>
force-app/main/default/lwc/tEnquiry/tEnquiry.js
@@ -17,8 +17,8 @@
import SearchAccountById from '@salesforce/apex/InspectCheckController.SearchAccountById';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader'
import GetInspectById from '@salesforce/apex/InspectCheckController.GetInspectById';
export default class test02 extends LightningElement {
@@ -33,22 +33,56 @@
    TongzhiIcon = 'standard:account' //提示框的图标
    IsLeftStyle = "" //提示框的样式
    BgColorStyle = "" 
    toastTime = null;
    isSuccess = false;
    message;
    visible;
    closeAction(){
        this.visible = false;
    }
    showToast(msg,type) {
        try {
            if(type == 'success'){
                this.isSuccess = true;
            }else{
                this.isSuccess = false;
            }
            this.message = msg;
            this.visible = true;
            let delay = 5000;
            console.log(this.message);
            console.log('1');
            // setTimeout(() => {
            //     this.visible = false;
            // }, delay );
        } catch (error) {
            console.log(error);
        }
    }
    Alert(content,error = false,left = false){
        this.Tongzhishow = false
        clearTimeout(this.toastTime)
        this.SaveShowText = content;
        this.Tongzhishow = true;
        
        if (error) {
            this.TongzhiIcon = "standard:first_non_empty";
            this.BgColorStyle = "background-color:#f88568";
            this.TongzhiIcon = "utility:error";
            this.BgColorStyle = "background-color:#ba0517 !important;padding: 9px 9px 9px 18px;";
        }else{
            this.TongzhiIcon = "standard:account";
            this.BgColorStyle = "background-color:#69e669";
            this.TongzhiIcon = "utility:success";
            this.BgColorStyle = "background-color:rgb(46, 132, 74)!important;padding: 9px 9px 9px 18px;";
            toastTime = setTimeout(() => {
               this.Tongzhishow = false
            },3000)
        }
        if (left) {
            this.IsLeftStyle = "left: 0.25rem;"
        }else{
            this.IsLeftStyle = ""
        }
        // if (left) {
        //     // this.IsLeftStyle = "left: 0.25rem;"
            this.IsLeftStyle = "width: 100%;top: 14%;display: flex;justify-content: center;"
        // }else{
        //     this.IsLeftStyle = "color:#fff"
        // }
    }
    CloseAlert()
    {
@@ -74,7 +108,9 @@
        return(false);
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
        ]);
       var paramId =  this.getQueryVariable('id');
       if (paramId == null || paramId == '') {
           return ;
@@ -145,7 +181,8 @@
                if (isloading == 2) {
                    this.OnLoading(false);
                    if (flag) {
                        this.Alert("保存成功",false,true);
                        // this.Alert("保存成功",false);
                        this.showToast('保存成功','success');
                    }
                }
            })
@@ -165,7 +202,8 @@
                if (isloading == 2) {
                    this.OnLoading(false);
                    if (flag) {
                        this.Alert("保存成功",false,true);
                        // this.Alert("保存成功",false);
                        this.showToast('保存成功','success');
                    }
                }
               
@@ -178,6 +216,11 @@
    //table 列表的数据
    @track  optionsdata=[
        {
            label:"状态1",
            props:"StageName__c",
            Type:"text",
        },
        {
            label:"询价名称",
            props:"Name",
            url:"Id",
@@ -187,12 +230,6 @@
            label:"询价编码",
            props:"Opportunity_No__c",
            Type:"text",
        },
        {
            label:"客户名",
            props:"Account_Name_F__c",
            url:"Id",
            Type:"url",
        },
        {
            label:"询价阶段",
@@ -205,10 +242,14 @@
            Type:"text",
        },
        {
            label:"状态1",
            props:"StageName__c",
            Type:"text",
            label:"客户名",
            props:"Account_Name_F__c",
            url:"Id",
            Type:"url",
        },
       
    ]
@@ -302,7 +343,8 @@
            isloading ++;
            if (isloading == 2) {
                this.OnLoading(false);
                this.Alert("保存成功",false,true);
                // this.Alert("保存成功",false);
                this.showToast('保存成功','success');
            }
        })
        
@@ -314,7 +356,8 @@
            isloading ++;
            if (isloading == 2) {
                this.OnLoading(false);
                this.Alert("保存成功",false,true);
                // this.Alert("保存成功",false);
                this.showToast('保存成功','success');
            }
        })
    }
@@ -328,7 +371,8 @@
        var flag =  this.compareSelected();
        if (flag == false) {
            this.OnLoading(false);
            this.Alert("医院不匹配,保存失败!",true);
            // this.Alert("医院不匹配,保存失败!",true);
            this.showToast('医院不匹配,保存失败!','error');
            return;
        }
        debugger;
@@ -345,9 +389,12 @@
                this.UpdateDatas(this.notselected);
                window.location.hash = "Refresh"+"=="+this.ParamIdStr;
                this.OnLoading(false);
                // this.Alert('保存成功',false);
                this.showToast('保存成功','success');
            }else{
                this.OnLoading(false);
                this.Alert(response,true,false);
                // this.Alert(response,true);
                this.showToast(response,'error');
            }
     
        });
force-app/main/default/pages/AssetMaintain.page
@@ -2,8 +2,25 @@
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<apex:includeScript value="{!URLFOR($Resource.SelectFieldJs)}"/>
<apex:stylesheet value="{!URLFOR($Resource.StyleUtilCss)}"/>
    <style>
         .datePicker {
            left: 805px !important;
            width: 350px !important;
        }
        .label{
            font-size: .75rem !important;
        }
        .labelCol{
            font-size: .75rem !important;
        }
        .dataCol{
            font-size: .75rem !important;
        }
        .textStyle{
            font-size: 15px;
        }
         /*20230815 ljh start*/
         table.mytable tr{
            height:45px;
@@ -35,7 +52,7 @@
        div#out_Div_R {
            position: relative;
            overflow: hidden;
            width: 1200px;
            width: 455px !important;
            margin-left: 686px;
        }
@@ -46,6 +63,7 @@
        }
        div#in_Div_R {
            position: relative;
            width: 470px !important;
            overflow: auto;
            height: 451px;
            margin-left: 686px;
@@ -601,18 +619,18 @@
                <apex:param name="csvMaintaintype" value="" />
            </apex:actionFunction>
            <apex:pageBlockSection columns="2">
                <apex:outputField value="{!amHeader.Name}"/>
                <apex:outputField value="{!amHeader.MaintainType__c}"/>
                <apex:outputField value="{!amHeader.Submit_Time__c}" rendered="{!amHeader.MaintainType__c=='实物报废'}"/>
                <apex:outputField value="{!amHeader.Date__c}" rendered="{!amHeader.MaintainType__c!='实物报废'}"/>
                <apex:outputField value="{!amHeader.Status__c}"/>
                <apex:outputField value="{!amHeader.Submit_Person__c}" rendered="{! amHeader.MaintainType__c=='实物报废'|| ISBLANK(amHeader.MaintainType__c) }"/>
                <apex:outputField styleClass="textStyle" value="{!amHeader.Name}"/>
                <apex:outputField styleClass="textStyle" value="{!amHeader.MaintainType__c}"/>
                <apex:outputField styleClass="textStyle" value="{!amHeader.Submit_Time__c}" rendered="{!amHeader.MaintainType__c=='实物报废'}"/>
                <apex:outputField styleClass="textStyle" value="{!amHeader.Date__c}" rendered="{!amHeader.MaintainType__c!='实物报废'}"/>
                <apex:outputField styleClass="textStyle" value="{!amHeader.Status__c}"/>
                <apex:outputField styleClass="textStyle" value="{!amHeader.Submit_Person__c}" rendered="{! amHeader.MaintainType__c=='实物报废'|| ISBLANK(amHeader.MaintainType__c) }"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection columns="1" rendered="{! amHeader.MaintainType__c=='实物报废'|| ISBLANK(amHeader.MaintainType__c) }">
                <apex:pageBlockSection columns="2" rendered="{! editmode}">
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel value="{!$ObjectType.AssetMaintainHeader__c.fields.CC_User1__c.Label}"/>
                        <apex:inputField value="{!amHeader.CC_User1__c}"/>
                        <apex:inputField id="SalesName1" value="{!amHeader.CC_User1__c}"/>
                    </apex:pageBlockSectionItem>
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel value="{!$ObjectType.AssetMaintainHeader__c.fields.CC_Email1__c.Label}"/>
@@ -620,7 +638,7 @@
                    </apex:pageBlockSectionItem>
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel value="{!$ObjectType.AssetMaintainHeader__c.fields.CC_User2__c.Label}"/>
                        <apex:inputField value="{!amHeader.CC_User2__c}"/>
                        <apex:inputField id="SalesName2" value="{!amHeader.CC_User2__c}"/>
                    </apex:pageBlockSectionItem>
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel value="{!$ObjectType.AssetMaintainHeader__c.fields.CC_Email2__c.Label}"/>
@@ -628,7 +646,7 @@
                    </apex:pageBlockSectionItem>
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel value="{!$ObjectType.AssetMaintainHeader__c.fields.CC_User3__c.Label}"/>
                        <apex:inputField value="{!amHeader.CC_User3__c}"/>
                        <apex:inputField id="SalesName3" value="{!amHeader.CC_User3__c}"/>
                    </apex:pageBlockSectionItem>
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel value="{!$ObjectType.AssetMaintainHeader__c.fields.CC_Email3__c.Label}"/>
@@ -636,12 +654,12 @@
                    </apex:pageBlockSectionItem>
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel value="{!$ObjectType.AssetMaintainHeader__c.fields.CC_User4__c.Label}"/>
                        <apex:inputField value="{!amHeader.CC_User4__c}"/>
                        <apex:inputField id="SalesName4" value="{!amHeader.CC_User4__c}"/>
                    </apex:pageBlockSectionItem>
                    <apex:pageBlockSectionItem />
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel value="{!$ObjectType.AssetMaintainHeader__c.fields.CC_User5__c.Label}"/>
                        <apex:inputField value="{!amHeader.CC_User5__c}"/>
                        <apex:inputField id="SalesName5" value="{!amHeader.CC_User5__c}"/>
                    </apex:pageBlockSectionItem>
                    <apex:pageBlockSectionItem />
                </apex:pageBlockSection>
@@ -682,7 +700,139 @@
                    <apex:pageBlockSectionItem />
                </apex:pageBlockSection>
            </apex:pageBlockSection>
            <script>
                let SelectFieldParamList=[
                   {
                       //原apex:inputField的id值,需要在页面上获取
                       inputFieldId : 'allPage:allForm:pageBlockButton1:j_id105:j_id106:j_id107:SalesName1',
                       //查找字段所在对象
                       ObjectType : 'AssetMaintainHeader__c',
                       //查找字段的api名称
                       QueryFieldApiName : 'CC_User1__c',
                       //查找字段的查找对象
                       SelectObj : 'User',
                       //搜索时使用的字段
                       SelectFld : 'Name',
                   },
                   {
                       //原apex:inputField的id值,需要在页面上获取
                       inputFieldId : 'allPage:allForm:pageBlockButton1:j_id105:j_id106:j_id112:SalesName2',
                       //查找字段所在对象
                       ObjectType : 'AssetMaintainHeader__c',
                       //查找字段的api名称
                       QueryFieldApiName : 'CC_User2__c',
                       //查找字段的查找对象
                       SelectObj : 'User',
                       //搜索时使用的字段
                       SelectFld : 'Name',
                   }, {
                   //原apex:inputField的id值,需要在页面上获取
                   inputFieldId : 'allPage:allForm:pageBlockButton1:j_id105:j_id106:j_id117:SalesName3',
                   //查找字段所在对象
                   ObjectType : 'AssetMaintainHeader__c',
                   //查找字段的api名称
                   QueryFieldApiName : 'CC_User3__c',
                   //查找字段的查找对象
                   SelectObj : 'User',
                   //搜索时使用的字段
                   SelectFld : 'Name',
                   }, {
                   //原apex:inputField的id值,需要在页面上获取
                   inputFieldId : 'allPage:allForm:pageBlockButton1:j_id105:j_id106:j_id122:SalesName4',
                   //查找字段所在对象
                   ObjectType : 'AssetMaintainHeader__c',
                   //查找字段的api名称
                   QueryFieldApiName : 'CC_User4__c',
                   //查找字段的查找对象
                   SelectObj : 'User',
                   //搜索时使用的字段
                   SelectFld : 'Name',
                   }, {
                   //原apex:inputField的id值,需要在页面上获取
                   inputFieldId : 'allPage:allForm:pageBlockButton1:j_id105:j_id106:j_id125:SalesName5',
                   //查找字段所在对象
                   ObjectType : 'AssetMaintainHeader__c',
                   //查找字段的api名称
                   QueryFieldApiName : 'CC_User5__c',
                   //查找字段的查找对象
                   SelectObj : 'User',
                   //搜索时使用的字段
                   SelectFld : 'Name',
                   },
                   ]
                   //初始化
                   resetOpenPage(SelectFieldParamList);
                   function unblockUI(){
                       j$("#sbArea").fadeOut(500, function(){
                           j$("#sbArea").remove();
                       });
                       resetOpenPage(SelectFieldParamList);
                   }
               </script>
            <table border="0">
                <tr>
                    <!-- <td style="width: 2%"></td> -->
@@ -772,7 +922,7 @@
                            else{
                                reportId = "{!notScrappedReportId}";
                            }
                            var url = `/lightning/r/Report/${reportId}?fv0=${maintainType}`;
                            var url = `/lightning/r/Report/${reportId}/view?fv0=${maintainType}`;
                            window.open(url);
                        }
                    </script>
@@ -798,7 +948,10 @@
                        <apex:inputText id="abandonCountId" style="width: 90%"/>
                    </td>
                    <td class="setButtonStyle"><apex:commandButton style="width: 70%" action="{!changeEditable}" value="编辑" onclick="blockme();" rerender="allForm" oncomplete="unblockUI();" disabled="{!!editButtonActive}" /></td>
                    <td class="setButtonStyle">
                        <apex:commandButton style="width: 70%" action="{!changeEditable}" value="编辑" onclick="blockme();" rerender="allForm" oncomplete="unblockUI();resetOpenPage(SelectFieldParamList);" disabled="{!!editButtonActive}" />
                    </td>
                    <td class="setButtonStyle">
                        <apex:commandButton style="width: 58%" value="适用" reRender="allForm" onclick="applyJs(); return false;" disabled="{!!editmode}"  />
                        <script type="text/javascript">
@@ -943,7 +1096,7 @@
                </table>
            </div>
            <div id="out_Div_R">
                <table class="list" border="1" style="border-collapse: collapse; table-layout:fixed; border-bottom-width: 0px; border-spacing:0; width:700px; height: 30px;">
                <table class="list" border="1" style="border-collapse: collapse; table-layout:fixed; border-bottom-width: 0px; border-spacing:0; width:455px; height: 30px;">
                    <tr class="headerRow" style="background-color: #DCDCDC; text-align: left; vertical-align: top;">
                        <apex:variable value="{!0}" var="cnt" />
                        <apex:repeat value="{!amdRightLabelList}" var="t">
@@ -1219,7 +1372,7 @@
                j$('select[id$=mlktp]').each(function() {
                    this.style.display="none";
                })
            </script>
        </apex:pageBlock>
    </apex:form>
force-app/main/default/pages/AssetMaintainDetail.page
@@ -3,10 +3,80 @@
    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
    <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
    <apex:includeScript value="{!URLFOR($Resource.RelationListPagingCmpJS)}"/>
    <apex:stylesheet value="{!URLFOR($Resource.StyleUtilCss)}"/><!-- 20230619 ljh lightning -->
    <style>
        #in_Div
        {
            height: 310px !important;
        }
        #in_Div_L
        {
            height: 295px !important;
        }
        .headerRow{
            height: 40px;
        }
        .headStyle td input{
            width: 150px;
        }
        .headStyle td input.btn{
            width: 70px;
        }
        .headStyle td{
            padding-left: 30px;
            padding-bottom: 10px;
        }
        body .bPageBlock .detailList .dataCol{
            width: 18%;
        }
        body .bPageBlock .detailList .labelCol{
            width: 8%;
        }
        table.list .col_Asset__r_Id {width:100px;}
        table.list .col_Asset__r_Internal_asset_location__c{width:100px;}
        table.list .col_Asset__r_Salesdepartment__c{width:100px;}
        table.list .col_Asset__r_SalesProvince__c{width:100px;}
        table.list .col_Asset__r_Fixture_Model_No_F__c{width:120px;}
        table.list .col_Asset__r_Internal_Asset_number_key__c{width:100px;}
        table.list .col_Asset__r_Internal_Asset_number__c{width:100px;}
        table.list .col_Asset__r_SerialNumberLink__c{width:100px;}
        table.list .col_Asset__r_Product_category__c {width:120px;}
        table.list .col_Asset__r_Equipment_Type__c {width:100px;}
        table.list .col_Asset__r_Consumable_Guaranteen_end__c {width:100px;}
        table.list .col_Asset__r_Manage_type__c {width:100px;}
        table.list .col_Asset__r_Loaner_accsessary__c {width:100px;}
        table.list .col_Asset__r_EquipmentSet_Managment_Code__c {width:100px;}
        table.list .col_Asset__r_AssetManageConfirm__c {width:100px;}
        table.list .col_Asset__r_Fixture_QRCode__c {width:100px;}
        table.list .col_Asset__r_WH_location__c {width:100px;}
        table.list .col_MaintainReason__c {width:100px;}
        table.list .col_MaintainCount__c {width:100px;}
        table.list .col_AbandonReason__c {width:100px;}
        table.list .col_AbandonCount__c  {width:100px;}
        table.list .col_Is_OneToOne_Accessory__c {width:120px;}
        table.list .col_Asset__r_Main_OneToOne__c {width:100px;}
        table.list .col_DisconnectCount__c {width:100px;}
        table.list .col_Asset__r_Quantity {width:100px;}
        table.list .col_Asset__r_You_Xiao_Ku_Cun__c {width:100px;}
        table.list .col_Asset__r_Abandoned_RealThing__c {width:100px;}
        table.list .col_Asset__r_Ji_Zhong_Guan_Li_Ku_Cun__c {width:100px;}
        table.list .col_Asset__r_In_wh_Fu_Shu_Pin_You_Xiao_Ku_Cun_Sum__c {width:140px;}
        table.list .col_Asset__r_Status {width:100px;}
        table.list .col_Asset__r_Fixture_Status__c {width:100px;}
        table.list .col_Asset__r_Frozen_Quantity__c {width:100px;}
    </style>
    <apex:form id="allForm">
        <apex:actionFunction name="searchOpp" action="{!searchOpp}" rerender="allForm" oncomplete="windowResize();unblockUI();"/>
        <apex:pageBlock id="searchBlock" title="维护明细画面">
            <apex:pageBlockSection columns="2">
            <apex:pageBlockSection columns="4">
                <apex:outputField value="{!parentObj.Name}"/>
                <apex:outputField value="{!parentObj.MaintainType__c}"/>
                <apex:outputField value="{!parentObj.Submit_Time__c}" rendered="{!parentObj.MaintainType__c=='实物报废'}"/>
@@ -16,42 +86,29 @@
            </apex:pageBlockSection>
            <apex:pageMessages />
            <table>
                <tr>
                    <td>关键字</td>
                    <td>
                        <apex:inputText value="{!keyword}"/>
                        <apex:commandButton value="检索" onclick="blockme();searchOpp(); return false;"/>
                    </td>
                    <td>备品配套明细型号</td>
                    <td><apex:inputText value="{!model}"/></td>
                    <td>固定资产编号</td>
                    <td><apex:inputField value="{!ass.Internal_Asset_number__c}"/></td>
                    <td>机身编码</td>
                    <td><apex:inputField value="{!ass.SerialNumber}"/></td>
                    <td>货架号</td>
                    <td><apex:inputField value="{!ass.WH_location__c}"/></td>
                <tr class='headStyle'>
                    <td>关键字:<apex:inputText value="{!keyword}"/></td>
                    <td>备品配套明细型号:<apex:inputText value="{!model}"/></td>
                    <td>固定资产编号:<apex:inputField value="{!ass.Internal_Asset_number__c}"/></td>
                    <td>机身编码:  <apex:inputField value="{!ass.SerialNumber}" style="width:152px"/></td>
                    <td>货架号:<apex:inputField value="{!ass.WH_location__c}"/></td>
                    <td><apex:commandButton value="检索" onclick="blockme();searchOpp(); return false;"/></td>
                </tr>
                <tr>
                    <td>备品存放地</td>
                    <td><apex:inputField value="{!ass.Internal_asset_location__c}"/></td>
                    <td>主体/附属品</td>
                    <td>
                        <apex:selectList value="{!mainOrAccessory}" size="1">
                <tr class='headStyle'>
                    <td>备品存放地:<apex:inputField value="{!ass.Internal_asset_location__c}" style="width:150px"/></td>
                    <td>主体/附属品:
                        <apex:selectList value="{!mainOrAccessory}" size="1" style="width:150px">
                            <apex:selectOptions value="{!mainOrAccessoryOptions}"/>
                        </apex:selectList>
                    </td>
                    <td>是否固定资产</td>
                    <td>
                        <apex:selectList value="{!isInternalAsset}" size="1">
                    <td>是否固定资产:
                        <apex:selectList value="{!isInternalAsset}" size="1" style="width:150px">
                            <apex:selectOptions value="{!isInternalAssetOptions}"/>
                        </apex:selectList>
                    </td>
                    <td>产品分类(GI/SP)</td>
                    <td><apex:inputField value="{!ass.Product_category__c}"/></td>
                    <td>备品分类</td>
                    <td><apex:inputField value="{!ass.Equipment_Type__c}"/></td>
                    <td>管理种类</td>
                    <td><apex:inputField value="{!ass.Manage_type__c}"/></td>
                    <td>产品分类(GI/SP):<apex:inputField value="{!ass.Product_category__c}" style="width:150px"/></td>
                    <td>备品分类:<apex:inputField value="{!ass.Equipment_Type__c}"/></td>
                    <td>管理种类:<apex:inputField value="{!ass.Manage_type__c}"/></td>
                </tr>
            </table>
        </apex:pageBlock>
force-app/main/default/pages/AssetMaintainIframe.page
@@ -37,10 +37,10 @@
                    <apex:commandButton styleClass="you-button" style="width: 100%;" value="数据维护" onclick="loadPage('/apex/AssetMaintain'); return false"/> 
                </div>
                <div style="margin-top:10px;">
                    <apex:commandButton style="width: 100%" value="数据维护单" onclick="window.open('/lightning/o/AssetMaintainHeader__c/list?filterName=Recent')"/>
                    <apex:commandButton style="width: 100%" value="数据维护单" onclick="window.open('/lightning/o/AssetMaintainHeader__c/list?filterName=Recent'); return false"/>
                </div>
                <div style="margin-top:10px;">
                    <apex:commandButton style="width: 100%" value="维护产品主数据" onclick="window.open('/lightning/o/Maintenance_Product_Data__c/list?filterName=Recent')"/>
                    <apex:commandButton style="width: 100%" value="维护产品主数据" onclick="window.open('/lightning/o/Maintenance_Product_Data__c/list?filterName=Recent'); return false"/>
                </div>
            </div>
force-app/main/default/pages/CheckAllOlympusAsset.page
@@ -4,6 +4,7 @@
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<apex:stylesheet value="{!URLFOR($Resource.StyleUtilCss)}"/>
    <style>
        .dateFormat  {
            display: none;
        }
@@ -37,12 +38,12 @@
        div#in_Div_L {
            position: relative;
            width: 745px;
            height: 451px;
            height: 470px !important;
        }
        div#in_Div_R {
            position: relative;
            overflow: auto;
            height: 451px;
            height: 485px !important;
            margin-left: 686px;
            margin-top: -451px;
        }
@@ -163,6 +164,22 @@
        // 改变table尺寸
        var heightAjustment = 120;
        var widthAjustment = 30;
        function showCalendar(inputId, position) {
        // 使用jQuery UI DatePicker或其他日期选择器库,将日历弹出到指定的位置
        // 这里假设您使用了jQuery UI DatePicker作为示例
        $("#" + inputId).datepicker({
            // 在这里配置DatePicker的选项
            // 比如,设置日期选择器的位置
            beforeShow: function(input, inst) {
                inst.dpDiv.addClass(position);
            }
        });
        // 手动触发日期选择器的显示
        $("#" + inputId).datepicker('show');
    }
        function windowResize() {
            blockHeight = j$(window).innerHeight() - j$(escapeVfId('allPage:allForm:searchBlock')).height() - j$(escapeVfId('allPage:allForm:dataBlock:pageBlockButton1')).height() - j$('table#msg').height() - heightAjustment;
            sbwidth = scrollbarWidth();
@@ -203,6 +220,7 @@
                j$('div#in_Div_R').css('width', (R_width-blockWidth-240 + sbwidth) + 'px');
            }
        }
        // 全选功能
        function selectAllJs() {
            j$(escapeVfId('checker')).prop('disabled', true);
@@ -588,7 +606,7 @@
                            <td class="blankStyle"></td>
                            <td class="labelStyle">消耗品有效期至</td>
                            <td class="inputTextStyle">
                                <apex:inputText id="consumable_Guaranteen_endStr" value="{!searchB.consumable_Guaranteen_endStr}" size="12" onfocus="DatePicker.pickDate(true, '{!$Component.consumable_Guaranteen_endStr}', false)" />
                                <apex:inputText id="consumable_Guaranteen_endStr" value="{!searchB.consumable_Guaranteen_endStr}" size="12" onfocus="DatePicker.pickDate(true, '{!$Component.consumable_Guaranteen_endStr}', false);showCalendar('consumable_Guaranteen_endStr','right');" />
                            </td>
                            <td class="blankStyle"></td>
                        </tr>
force-app/main/default/pages/ConsumApplyBR.page
@@ -74,7 +74,7 @@
                version.ContentLocation = 's';
                version.PathOnClient= "BRCode-{!Consum_Apply__c.Name_No__c}.jpg";
                var versionResult = sforce.connection.create([version]);
                record = sforce.connection.query("SELECT ContentDocumentId FROM ContentVersion WHERE Id =\'" + versionResult[0].id + "\'");
                record = sforce.connection.query("SELECT Id,ContentDocumentId FROM ContentVersion WHERE Id =\'" + versionResult[0].id + "\'");
                var records = record.getArray("records");
                var link = new sforce.SObject("ContentDocumentLink");
                link.ContentDocumentId = records[0].ContentDocumentId;
@@ -85,14 +85,18 @@
                var es = new sforce.SObject("Consum_Apply__c");
                es.Id = "{!Consum_Apply__c.Id}";
                es.BRId__c = records[0].ContentDocumentId;
                es.BRId__c = records[0].Id;
                result = sforce.connection.update([es]);
            //申请书更新失败的话再次更新
            } else if ("{!Consum_Apply__c.BRId__c}" == '' || "{!Consum_Apply__c.BRId__c}" == null) {
                var records = record.getArray("records");
                var version = new sforce.SObject("ContentVersion");
                version = sforce.connection.query("select Id,ContentDocumentId from ContentVersion where ContentDocumentId = \'" + records[0].Id + "\'");
                version = version.getArray("records");
                // 存在qr时,绑到申请单上
                var es = new sforce.SObject("Consum_Apply__c");
                es.Id = "{!Consum_Apply__c.Id}";
                es.BRId__c = records[0].Id;
                es.BRId__c = version[0].Id;
                result = sforce.connection.update([es]);
                // TODO Name変わる可能性あり、upsertにします
            } else {
force-app/main/default/pages/DiscountProductApplication.page
@@ -5,6 +5,7 @@
<apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/>
<apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
<apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
<apex:includeScript value="{!URLFOR($Resource.SelectFieldJs)}"/>
<style>
    /*信息提示颜色*/
body .bPageBlock .pbSubheader, .slds-vf-scope .bPageBlock .pbSubheader{
@@ -53,9 +54,10 @@
            if (flag == true) {
                // var accid = j$(escapeVfId('dpaPage:dpaForm:dpaBlock:rawAccountId_lkid')).value();
                var accid = j$(escapeVfId('dpaPage:dpaForm:dpaBlock:rawAccountId')).value();
                openPopup('/apex/searchAimsAccount?accName='+accid, 'setsearch', 800, 600, 'width=900,height=600,scrollbars=yes,toolbar=no,status=no,directories=no,menubar=no,resizable=1', true);
                var protype = j$(escapeVfId('dpaPage:dpaForm:dpaBlock:protype')).value();
                openPopup('/apex/searchAimsAccount?accName='+accid+'&protype='+protype, 'setsearch', 800, 600, 'width=900,height=600,scrollbars=yes,toolbar=no,status=no,directories=no,menubar=no,resizable=1', true);
            }else{
                openPopup('/apex/searchAimsAccount?accId={!dpa.RawAccount__c }', 'setsearch', 800, 600, 'width=900,height=600,scrollbars=yes,toolbar=no,status=no,directories=no,menubar=no,resizable=1', true);
                openPopup('/apex/searchAimsAccount?accId={!dpa.RawAccount__c }&protype='+protype, 'setsearch', 800, 600, 'width=900,height=600,scrollbars=yes,toolbar=no,status=no,directories=no,menubar=no,resizable=1', true);
            }
        }
@@ -140,12 +142,17 @@
            // j$(escapeVfId('dpaPage:dpaForm:dpaBlock:tempid')).value() = 'tempid';
        }
        function ProtypeChangeJs() {
            blockme();
            ProtypeChange();
        }
        //add by rentx 2021-2-20
    </script>
    <apex:form id="dpaForm" >
        <apex:actionFunction name="search" action="{!searchAllProduct2}" oncomplete="unblockUI();" reRender="ConsumableorderdetailsSection,message" />
        <apex:actionFunction name="ProtypeChange" action="{!ProtypeChange}" oncomplete="unblockUI();" reRender="ConsumableorderdetailsSection,message" />
        <apex:pageBlock title="特价产品申请信息" id="dpaBlock" >
            <apex:pageBlockButtons location="top"  >
                <apex:commandButton value="保存" disabled="{!IF(dpa.ApplicationStatus__c='申请中'||dpa.ApplicationStatus__c='批准'||dpa.ApplicationStatus__c='驳回',true,false)}" onclick="blockme();" style="margin-left:30px;width:100px;float: left;" action="{!savesaveDiscountProduct}" onComplete="unblockUI();CheckStatusAfter();" reRender="ConsumableorderdetailsSection,message"/>
@@ -156,37 +163,38 @@
                    <td align="left">
                        <!-- //update by rentx 2021-2-22 start -->
                        <apex:outputField rendered="{!!isPage}" value="{!dpa.RawAccount__c}" style="width:300px"/>
                        <apex:inputField id="rawAccountId" rendered="{!isPage}" required="true" value="{!dpa.RawAccount__c}" />
                        <apex:inputField id="rawAccountId" rendered="{!isPage}" required="true" value="{!dpa.RawAccount__c}" style="width:150px"/>
                        <!-- //update by rentx 2021-2-22 end -->
                    </td>
                    <td/>
                    <!-- // DB202309406949 gzw start -->
                    <td align="right" >产品类型:</td>
                    <td>
                        <apex:inputField id="protype" value="{!dpa.Product_Type__c}" style="width:150px" onchange="ProtypeChangeJs();return false;" rendered="{!IF(dpa.ApplicationStatus__c='草案中' || dpa.ApplicationStatus__c=null,true,false)}"/>
                        <apex:outputField id="protypeout" value="{!dpa.Product_Type__c}" style="width:150px" rendered="{!IF(!(dpa.ApplicationStatus__c='草案中' || dpa.ApplicationStatus__c=null),true,false)}"/>
                    </td>
                    <td align="right">医院:
                    </td>
                    <td width="100px"><apex:inputText id="AimsAccount" disabled="{!IF(dpa.ApplicationStatus__c='申请中'||dpa.ApplicationStatus__c='批准'||dpa.ApplicationStatus__c='驳回',true,false)}" style="width:150px" value="{!AimsAccount}" onclick="searchAimsAccount1()"  
                        onfocus="if (j$(escapeVfId('dpaPage:dpaForm:dpaBlock:tempid')).value() != 'tempId' && j$(escapeVfId('dpaPage:dpaForm:dpaBlock:tempid')).value() != '') {searchFn()}" />
                        onfocus="if (j$(escapeVfId('dpaPage:dpaForm:dpaBlock:tempid')).value() != 'tempId' && j$(escapeVfId('dpaPage:dpaForm:dpaBlock:tempid')).value() != '') {searchFn()}"/>
                    </td>
                    <td style="display:none"><apex:inputText style="display:none" id="AimsAccountId" value="{!AimsAccountId}"/></td>
                    <td style="display:none"><apex:inputText style="display:none"  value="{!dpa.ApplicationStatus__c }"/></td>
                    <apex:inputHidden id="tempid" value="{!tempVal}"/>
                    <td>
                        <!-- <apex:commandButton value="保存" disabled="{!IF(dpa.ApplicationStatus__c='申请中'||dpa.ApplicationStatus__c='批准'||dpa.ApplicationStatus__c='驳回',true,false)}" onclick="blockme();" style="margin-left:30px;width:180px" action="{!savesaveDiscountProduct}" onComplete="unblockUI();CheckStatusAfter();" reRender="ConsumableorderdetailsSection,message"/> -->
                        <!-- <apex:commandButton value="保存" disabled="{!IF(dpa.ApplicationStatus__c='申请中'||dpa.ApplicationStatus__c='批准'||dpa.ApplicationStatus__c='驳回',true,false)}" onclick="blockme();saveAimsAccountId();" style="margin-left:30px;width:180px" action="{!savesaveDiscountProduct}" onComplete="unblockUI();CheckStatusAfter();" reRender="ConsumableorderdetailsSection,message"/> -->
                    </td>
                    <!-- <td/> -->
                </tr>
                <tr style="height: 10px" />
                <tr>
                    <td align="right" >产品名称:</td>
                    <td align="left"><apex:inputText disabled="{!IF(dpa.ApplicationStatus__c='申请中'||dpa.ApplicationStatus__c='批准'||dpa.ApplicationStatus__c='驳回',true,false)}" value="{!text1}" style="width:300"/>
                    <td align="left"><apex:inputText disabled="{!IF(dpa.ApplicationStatus__c='申请中'||dpa.ApplicationStatus__c='批准'||dpa.ApplicationStatus__c='驳回',true,false)}" value="{!text1}" style="width:150px"/>
                    </td>
                    <td/>
                    <td align="right" >产品编码:</td>
                    <td align="left"><apex:inputText disabled="{!IF(dpa.ApplicationStatus__c='申请中'||dpa.ApplicationStatus__c='批准'||dpa.ApplicationStatus__c='驳回',true,false)}" value="{!text2}" style="width:150px"/>
                    </td>
                    <td><apex:commandButton value="检索" disabled="{!IF(dpa.ApplicationStatus__c='申请中'||dpa.ApplicationStatus__c='批准'||dpa.ApplicationStatus__c='驳回',true,false)}" onclick="blockme();" style="margin-left:30px;width:100px" action="{!searchAllProduct2}" oncomplete="unblockUI();" reRender="ConsumableorderdetailsSection,message"/>
                    <td colspan="2"><apex:commandButton value="检索" disabled="{!IF(dpa.ApplicationStatus__c='申请中'||dpa.ApplicationStatus__c='批准'||dpa.ApplicationStatus__c='驳回',true,false)}" onclick="blockme();" style="margin-left:30px;width:100px" action="{!searchAllProduct2}" oncomplete="unblockUI();" reRender="ConsumableorderdetailsSection,message"/>
                    </td>
                </tr>
            </table>
@@ -260,4 +268,32 @@
                </table>
             </apex:pageBlock>
    </apex:form>
    <script>
        let SelectFieldParamList=[
{
    //原apex:inputField的id值,需要在页面上获取
    inputFieldId : 'dpaPage:dpaForm:dpaBlock:rawAccountId',
    //查找字段所在对象
    ObjectType : 'DiscountProductApplication__c',
    //查找字段的api名称
    QueryFieldApiName : 'RawAccount__c',
    //查找字段的查找对象
    SelectObj : 'Account',
    //搜索时使用的字段
    SelectFld : 'Name'
}];
resetOpenPage(SelectFieldParamList);
    </script>
</apex:page>
force-app/main/default/pages/Enquiry.page
@@ -1,6 +1,11 @@
<apex:page showHeader="false" sidebar="false" id="test02" title="3.关联已有询价">
    <apex:includeLightning />
    <div style="width:100%;height:100%;" id="test02Container" />
    <style>
        .slds-theme_error{
            --lwc-colorBackgroundToastError: #ba0517 !important;
        }
    </style>
    <script>
        $Lightning.use("c:test02App", function () {
            $Lightning.createComponent("c:tEnquiry",
force-app/main/default/pages/ImprovedForecastTime.page
@@ -1,12 +1,14 @@
<apex:page showHeader="false" sidebar="false" id="ImprovedForecastTimeApp" title="预测日期改变" lightningStylesheets="true">
<apex:page showHeader="false" sidebar="false" id="ImprovedForecastTimeApp" title="预测日期改变">
    <apex:includeLightning />
    <div style="width:100%;height:100%;" id="ImprovedForecastTimeApp" />
    <script>
        $Lightning.use("c:ImprovedForecastTimeApp", function () {
        $Lightning.use("c:ImprovedForecastTimeAura", function () {
            $Lightning.createComponent("c:ImprovedForecastTime",
                {},
                "ImprovedForecastTimeApp",
                {
                    "recordId": getParam('id')
                },
                "ImprovedForecastTimeAura",
                function (cmp) {
                    console.log('Component created, do something cool here');
                });
@@ -21,6 +23,14 @@
                clearInterval(interval);
            }
        },1000);
        function getParam(paramName) {
        paramValue = "", isFound = !1;
        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;
        }
    </script>
</apex:page>
force-app/main/default/pages/ImprovedForecastTimeAno.page
@@ -1,36 +1,64 @@
<apex:page showHeader="false" sidebar="false" id="ImprovedForecastTimeApp" title="预测日期改变">
<apex:page showHeader="false" sidebar="false" id="ImprovedForecastTimeApp" title="预测日期改变" lightningStylesheets="true">
    <apex:includeLightning />
    <div style="width:100%;height:100%;" id="ImprovedForecastTimeApp" />
    <style>
        .slds-theme_error{
            --lwc-colorBackgroundToastError: #ba0517 !important;
        }
    </style>
    <script>
        $Lightning.use("c:ImprovedForecastTimeApp", function () {
            $Lightning.createComponent("c:ImprovedForecastTime",
                {},
                "ImprovedForecastTimeApp",
                function (cmp) {
                    console.log('Component created, do something cool here');
                });
        });
        init();
        function init(){
            var id = getParam('id');
            console.log(id);
            $Lightning.use("c:ImprovedForecastTimeApp", function () {
                $Lightning.createComponent("c:lexImprovedForecastTimeNew",
                    {
                        'recordId': id
                    },
                    "ImprovedForecastTimeApp",
                    function (cmp) {
                        var errorMessageElement = document.getElementById('auraErrorMessage');
        var interval = setInterval(()=>{
            var hrefStr = window.location.href;
            if (hrefStr.indexOf("Refresh") != -1) {
                // var query = window.location.search.substring(1);
                // var vars = query.split("&");
                // var oppId = '';
                // for (var i = 0; i < vars.length; i++) {
                //     var pair = vars[i].split("=");
                //     if (pair[0] == 'id') {
                //         oppId = pair[1];
                //     }
                // }
                // if (oppId != '') {
                //     window.open('/'+oppId, '_self');
                // }
                top.window.close();
                clearInterval(interval);
            }
        },1000);
                    // 检查是否找到了元素
                    if (errorMessageElement) {
                        // 隐藏元素
                        errorMessageElement.style.display = 'none';
                    }
                    });
            });
        }
        // var interval = setInterval(()=>{
        //     var hrefStr = window.location.href;
        //     if (hrefStr.indexOf("Refresh") != -1) {
        //         // var query = window.location.search.substring(1);
        //         // var vars = query.split("&");
        //         // var oppId = '';
        //         // for (var i = 0; i < vars.length; i++) {
        //         //     var pair = vars[i].split("=");
        //         //     if (pair[0] == 'id') {
        //         //         oppId = pair[1];
        //         //     }
        //         // }
        //         // if (oppId != '') {
        //         //     window.open('/'+oppId, '_self');
        //         // }
        //         top.window.close();
        //         clearInterval(interval);
        //     }
        // },1000);
        function getParam(paramName) {
        paramValue = "", isFound = !1;
        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;
        }
    </script>
</apex:page>
force-app/main/default/pages/InventoryReport.page
@@ -3,6 +3,7 @@
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:stylesheet value="{!URLFOR($Resource.StyleUtilColorCss)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<apex:includeScript value="{!URLFOR($Resource.SelectFieldJs)}"/>
    <style>
        .dateFormat  {
            display: none;
@@ -116,24 +117,12 @@
            width: 9%;
            padding: 5px;
        }
        .labelStyle1{
            width: 7%;
        }
        .tdStyle-left {
            /*20220419 ljh HWAG-CAV5WX update */
            /*width: 16%;*/
            width: 11%;
            padding: 5px;
            text-align: left;
        }
        .tdStyle-left1{
            width: 7.5%;
            padding: 5px;
            text-align: left;
        }
        .tdStyle-right1{
            width: 9%;
            padding: 5px;
        }
        .tdStyle-right {
            /*20220419 ljh HWAG-CAV5WX update */
@@ -206,7 +195,13 @@
        .requiredInput {
            position: relative;
            height: 100%;
            display:inline-block;/*20230912 ljh add*/
        }
        /* 20230912 ljh start */
        .InventoryResult .requiredInput{
            display:block;
        }
        /* 20230912 ljh end */
        .requiredBlock  {
            background-color: #c00;
            position: absolute;
@@ -215,14 +210,16 @@
            top: 1px;
            bottom: 1px;
        }
        body .pbBody table.list tr.headerRow td,body .pbBody table.list tr.headerRow th {
            background: #f2f3f3;
            border-width: 0 0 1px 1px;
            border-color: #e0e3e5;
            font-size: .9em;
            font-weight: bold;
        .my-left{
            width: 49%;
            padding: 5px;
            text-align: left;
        }
        /*20230921 ljh add start*/
        body td.actionColumn:before {
            content: normal;
        }
        /*20230921 ljh add end*/
    </style>
    <style type="text/css" media="print">
        .hiddenPrint{display:none !important;}
@@ -295,7 +292,7 @@
            window.open("{!$Label.Environment_Url}lightning/r/Report/{!diushiReportId}/view?fv1={!ihId}");
            // 20230907 ljh end
        }  
        <!--20210525 you 1650  start-->
        // <!--20210525 you 1650  start-->
        // 调拨出借记录
        function transfer_chujie_report() {
            // 20230907 ljh start
@@ -310,7 +307,7 @@
            window.open("{!$Label.Environment_Url}lightning/r/Report/{!transferdiushiReportId}/view?fv1={!ihId}");
            // 20230907 ljh end
        }
        <!--20210525 you 1650  end-->
        // <!--20210525 you 1650  end-->
        // 耗材出借记录
        function consum_chujie_report() {
            // 20230907 ljh start
@@ -333,19 +330,10 @@
            <apex:param value="" name="saveType"/>
        </apex:actionFunction>
        <apex:pageBlock id="searchBlock">
            <!-- <apex:outputPanel layout="block" style="width: 13%; float: left;">
                <apex:pageBlock mode="maindetail">
                    <table style='width:140px; height: 80px'>
                        <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>
                    </table>
                </apex:pageBlock>
            </apex:outputPanel> -->
            <apex:outputPanel id="RightArea" layout="block" style="margin: 0 20%;">
            <!-- 20230912 ljh update -->
            <!-- <apex:outputPanel id="RightArea" layout="block" style="margin: 0 20%;"> -->
            <apex:outputPanel id="RightArea" layout="block" style="margin: 0 5%;" >
            <!-- 20230912 ljh update end -->
                <apex:outputPanel id="message" style="width: auto" >
                    <apex:pageMessages />
                </apex:outputPanel>
@@ -359,63 +347,101 @@
                            rendered="{!canDoFlg}" />
                </div>
                <p style="margin:10px auto; width:100%; text-align: center; font-weight:bold; font-size:22px;">OCSM医疗备品管理中心{!IF(isConsum,'耗材','备品')}盘点报告书</p>
                <table class="inventoryReportTable" style="width: 50%;">
                <table class="inventoryReportTable" style="width: 100%;">
                    <colgroup>
                        <col width="49%"/>
                        <col width="49%"/>
                    </colgroup>
                    <tr>
                        <td class="labelStyle">盘点部门/分公司:</td>
                        <td class="labelStyle">{!inventoryDepartment}</td>
                        <!-- 20230912 ljh update -->
                        <td class="labelStyle">盘点部门/分公司:{!inventoryDepartment}</td>
                        <!-- <td class="labelStyle">{!inventoryDepartment}</td> -->
                    </tr>
                    <tr>
                        <td class="labelStyle">盘点报告书编号:</td>
                        <td class="labelStyle" style="color: blue">{!ihObj.Name}</td>
                        <!-- 20230912 ljh update -->
                        <td class="labelStyle">盘点报告书编号:<span  style="color: blue">{!ihObj.Name}</span></td>
                        <!-- <td class="labelStyle" style="color: blue">{!ihObj.Name}</td> -->
                    </tr>
                    <tr>
                        <td class="labelStyle">提交报告日期:</td>
                        <td class="labelStyle">
                        <!-- 20230912 ljh update -->
                        <td class="labelStyle">提交报告日期:<span class="labelStyle">
                            <apex:outputText id="ivSubmitDate" value="{0,date,yyyy'/'MM'/'dd}">
                                <apex:param value="{!ihObj.Inventory_Submit_Date__c}" />
                            </apex:outputText>
                            </span></td>
                        <!-- <td class="labelStyle">
                        <apex:outputText id="ivSubmitDate" value="{0,date,yyyy'/'MM'/'dd}">
                            <apex:param value="{!ihObj.Inventory_Submit_Date__c}" />
                        </apex:outputText>
                    </td>
                        </td> -->
                    </tr>
                </table>
                <hr class="line" />
                <table class="inventoryReportTable">
                <table class="inventoryReportTable" width="100%">
                    <tr>
                        <td class="labelStyle1">盘点地点:</td>
                        <td class="labelStyle">
                        <!-- 20230912 ljh update -->
                        <td class="my-left"><label>盘点地点:</label>
                            <apex:outputText id="ivLocation" value="{!ihObj.Internal_asset_location__c}" />
                        </td>
                        <td class="labelStyle">开始盘点时间:</td>
                        <td class="labelStyle">
                        <!-- <td class="labelStyle">
                            <apex:outputText id="ivLocation" value="{!ihObj.Internal_asset_location__c}" />
                        </td> -->
                        <td class="my-left"><label>开始盘点时间:</label>
                            <apex:outputText id="ivDate" value="{0,date,yyyy'/'MM'/'dd}">
                                <apex:param value="{!ihObj.Inventory_Start_Date__c}" />
                            </apex:outputText>
                        </td>
                        <!-- <td class="labelStyle">
                            <apex:outputText id="ivDate" value="{0,date,yyyy'/'MM'/'dd}">
                                <apex:param value="{!ihObj.Inventory_Start_Date__c}" />
                            </apex:outputText>
                        </td> -->
                    </tr>
                    <tr>
                        <td class="labelStyle1">盘点时间From:</td>
                        <td class="labelStyle">
                        <!-- 20230912 ljh update -->
                        <td class="my-left" width="50%" ><label>盘点时间From:</label>
                            <apex:inputField id="ivDateFrom" value="{!ihObj.Inventory_Date_From__c}"
                                    required="{!DESC_RW1['Inventory_Date_From__c'] == 'wm'}"/>
                                        required="{!DESC_RW1['Inventory_Date_From__c'] == 'wm'}" />
                        </td>
                        <td class="labelStyle">盘点时间To:</td>
                        <td class="labelStyle">
                        <!-- <td class="labelStyle">
                            <apex:inputField id="ivDateFrom" value="{!ihObj.Inventory_Date_From__c}"
                                    required="{!DESC_RW1['Inventory_Date_From__c'] == 'wm'}" />
                        </td> -->
                        <!-- 20230912 ljh update -->
                        <td class="my-left" width="50%" ><label>盘点时间To:</label>
                            <apex:inputField id="ivDateTo" value="{!ihObj.Inventory_Date_To__c}"
                                        required="{!DESC_RW1['Inventory_Date_To__c'] == 'wm'}" />
                        </td>
                        <!-- <td class="labelStyle">
                            <apex:inputField id="ivDateTo" value="{!ihObj.Inventory_Date_To__c}"
                                    required="{!DESC_RW1['Inventory_Date_To__c'] == 'wm'}" />
                        </td>
                        </td> -->
                    </tr>
                    <tr>
                        <td class="labelStyle1">盘点人员:</td>
                        <td class="labelStyle" colspan="3">
                        <td colspan="2" aligh="left" style="padding: 5px;width:100%;"><label>盘点人员:</label><apex:inputField id="ivPIC" style="width: 90%;" value="{!ihObj.Inventory_Persons__c}"
                            required="{!DESC_RW1['Inventory_Persons__c'] == 'wm'}" /></td>
                        <!-- <td class="labelStyle" colspan="3">
                            <apex:inputField id="ivPIC" style="width: 100%;" value="{!ihObj.Inventory_Persons__c}"
                                    required="{!DESC_RW1['Inventory_Persons__c'] == 'wm'}" />
                        </td>
                        </td> -->
                    </tr>
                </table>
                <hr class="line" />
                <table class="inventoryReportTable" width="100%" >
                    <tr>
                        <td class="tdStyle-left1">盘点报告提交人:</td>
                        <td class="tdStyle-left">
                        <!-- 20230912 ljh update -->
                        <td class="my-left"><label>盘点报告提交人:</label>
                                <apex:inputField id="ivsubmitPIC" value="{!ihObj.InventorySubmit_PIC__c}"
                                    required="{!DESC_RW1['InventorySubmit_PIC__c'] == 'wm'}" >
    <script>
    if( document.getElementById('allPage:allForm:searchBlock:ivsubmitPIC_mlktp')){
        document.getElementById('allPage:allForm:searchBlock:ivsubmitPIC_mlktp').style.display="none" ;
    }
    </script>
                                </apex:inputField>
                        </td>
                        <!-- <td class="tdStyle-left">
                            <apex:inputField id="ivsubmitPIC" value="{!ihObj.InventorySubmit_PIC__c}"
                                required="{!DESC_RW1['InventorySubmit_PIC__c'] == 'wm'}" >
<script>
@@ -424,14 +450,15 @@
}
</script>
                            </apex:inputField>
                        </td>
                        <td class="tdStyle-right1">职位:</td>
                        <td class="tdStyle-left">
                        </td> -->
                        <td class="my-left"><label>职位:</label><apex:outputText id="ivsubmitPICPost" value="{!ihObj.InventorySubmit_PIC__r.Post__c}" /></td>
                        <!-- <td class="tdStyle-left">
                            <apex:outputText id="ivsubmitPICPost" value="{!ihObj.InventorySubmit_PIC__r.Post__c}" />
                        </td>
                        </td> -->
                    </tr>
                    <tr>
                        <td class="tdStyle-left1">盘点报告确认人:</td>
                        <!-- 20230912 ljh update -->
                        <!-- <td class="tdStyle-left">盘点报告确认人:</td>
                        <td class="tdStyle-left">
                            <apex:inputField id="ivcheckPIC" value="{!ihObj.InventoryCheck_PIC__c}"
                                required="{!DESC_RW1['InventoryCheck_PIC__c'] == 'wm'}" >
@@ -442,9 +469,21 @@
</script>
                            </apex:inputField>
                        </td>
                        <td class="tdStyle-right1">职位:</td>
                        <td class="tdStyle-right">职位:</td>
                        <td class="tdStyle-left">
                            <apex:outputText id="ivcheckPICPost" value="{!ihObj.InventoryCheck_PIC__r.Post__c}" />
                        </td> -->
                        <td class="my-left"><label>盘点报告确认人:</label>
                            <apex:inputField id="ivcheckPIC" value="{!ihObj.InventoryCheck_PIC__c}"
                                required="{!DESC_RW1['InventoryCheck_PIC__c'] == 'wm'}" >
<script>
if( document.getElementById('allPage:allForm:searchBlock:ivcheckPIC_mlktp')){
    document.getElementById('allPage:allForm:searchBlock:ivcheckPIC_mlktp').style.display="none" ;
}
</script>
                            </apex:inputField>
                        </td>
                        <td class="my-left"><label>职位:</label><apex:outputText id="ivcheckPICPost" value="{!ihObj.InventoryCheck_PIC__r.Post__c}" />
                        </td>
                    </tr>
                </table>
@@ -484,7 +523,7 @@
                        <apex:commandButton styleClass="hiddenPrint" value="耗材消耗记录"  onclick="consum_xiaohao_report(); return false;" />
                    </apex:outputPanel>
                </div>
                <apex:outputPanel id="InventoryResult">
                <apex:outputPanel id="InventoryResult" styleClass="InventoryResult">
                    <table style="{!IF(isConsum,'display: none;','')}" class="inventoryReportTable" border="1px">
                        <tr>
                            <th class="labelStyle">固定资产</th>
@@ -610,4 +649,63 @@
    <apex:outputPanel styleClass="hiddenPrint" id="process">
        <apex:relatedList list="ProcessSteps" ></apex:relatedList>
    </apex:outputPanel>
    <script>
    let SelectFieldParamList=[
{
    //原apex:inputField的id值,需要在页面上获取
    inputFieldId : 'allPage:allForm:searchBlock:ivsubmitPIC',
    //查找字段所在对象
    ObjectType : 'Inventory_Header__c',
    //查找字段的api名称
    QueryFieldApiName : 'InventorySubmit_PIC__c',
    //查找字段的查找对象
    SelectObj : 'User',
    //搜索时使用的字段
    SelectFld : 'Name',
},
{
    //原apex:inputField的id值,需要在页面上获取
    inputFieldId : 'allPage:allForm:searchBlock:ivcheckPIC',
    //查找字段所在对象
    ObjectType : 'Inventory_Header__c',
    //查找字段的api名称
    QueryFieldApiName : 'InventoryCheck_PIC__c',
    //查找字段的查找对象
    SelectObj : 'User',
    //搜索时使用的字段
    SelectFld : 'Name',
},
]
//初始化
resetOpenPage(SelectFieldParamList);
    </script>
</apex:page>
force-app/main/default/pages/LostEditPage1.page
@@ -9,7 +9,7 @@
            var ReportId = getParam('id');
            if(!ReportId){
                alert('报告没有ID,请重试!');
                window.open('/006/o','_self');
                window.open('/006/o');
                return;
            }
            sforce.connection.sessionId = '{!GETSESSIONID()}';
@@ -40,7 +40,7 @@
            if(getParam('retURL') != null){
                str += '&retURL='+getParam('retURL');
            }
            window.open(str,'_self');
            window.open(str);
        }
        function getParam(paramName) {
            paramValue = "", isFound = !1;
@@ -54,7 +54,7 @@
        //失单报告的ID
        var ReportId = getParam('id');
        var str = '/apex/PCLLostReportPageLwc?pageStatus=Edit&reportId=' + ReportId;
        window.open(str,'_self');
        window.open(str);
    
        }
    </script>
force-app/main/default/pages/LostViewPage1.page
@@ -9,7 +9,7 @@
        console.log('1');
        var ReportId = getParam('id');
        if(!ReportId){
            window.open('/006/o','_self');
            window.open('/006/o');
            return;
        }
        sforce.connection.sessionId = '{!GETSESSIONID()}';
@@ -38,7 +38,7 @@
         if(getParam('retURL') != null){
            str += '&retURL='+getParam('retURL');
        }
          window.open(str,'_self');
          window.open(str);
    }
    function getParam(paramName) {
        paramValue = "", isFound = !1;
@@ -52,7 +52,7 @@
        //失单报告的ID
        var ReportId = getParam('id');
        var str = '/apex/PCLLostReportPageLwc?pageStatus=View&reportId=' + ReportId;
        window.open(str,'_self');
        window.open(str);
        
        
       }
force-app/main/default/pages/MaintenanceProductData.page
@@ -3,6 +3,7 @@
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/>
<apex:includeScript value="{!URLFOR($Resource.SelectFieldJs)}"/>
<style type="text/css">
/*信息提示颜色*/
body .bPageBlock .pbSubheader, .slds-vf-scope .bPageBlock .pbSubheader{
@@ -992,7 +993,8 @@
                    <td style="width: 30px;"></td>
                    <!-- <td colspan="{!IF(RecordTypeName = 'GuranteePrice'|| RecordTypeName ='GuranteeMain', 12,12)}"></td> -->
                    <!-- <td align="right"></td> -->
                    <td colspan="2" align="right"><apex:commandButton value="产品搜索" style="width: 100px;" onclick="searchProductJs();return false;" reRender="mpdDetailsSection" /></td>
                    <td colspan="2" align="right"><apex:commandButton value="产品搜索" style="width: 100px;" onclick="searchProductJs();" reRender="mpdDetailsSection" oncomplete="refreshinput();"/></td>
                    <td colspan="2" align="left" style="padding-left:20px; "><input type="button" value="清空" style="width: 100px;" onclick="ClearJs();return false;" class="btn"/></td>
                    <td colspan="{!IF(RecordTypeName = 'GuranteePrice'|| RecordTypeName ='GuranteeMain', 2,4)}"></td>
                    
@@ -1083,10 +1085,16 @@
                        </span>
                    </td>
                    <td><input type="checkbox" id="GuranteeMain8" /></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <!-- <apex:repeat value="{!title}" var="t">
                        <td></td>
                    </apex:repeat> -->
                    <!-- <apex:outputPanel layout="none" rendered="{!IF(RecordTypeName = 'GuranteeMain',true , false)}">
                        <td></td>
                        <td></td>
                        <td></td>
                    </apex:outputPanel> -->
                    <!-- <td></td>
                    <td>
                        <input  name="Intra_Trade_Service_RMB" id="GuranteeMain5" size="20" type="number" value="" disabled="true" />
@@ -1263,7 +1271,7 @@
        <apex:outputPanel id="allPanel">
            <apex:pageBlock id="allBlock" >
                <apex:pageblocksection title="{!IF(editAble,'产品主数据维护','产品主数据维护(蓝色为新值)')}" id="edmpdDetails" rendered="{!IF(mpdDetailsRecordsCount >0,true,false)}" html-style="width: 100%;overflow:auto;">
                <apex:pageblocksection title="{!IF(editAble,'产品主数据维护','产品主数据维护(蓝色为新值)')}" id="edmpdDetails" rendered="{!IF(mpdDetailsRecordsCount >0,true,false)}" html-style="width: 100%;max-height:210px;;overflow:auto;">
                <apex:outputLabel style="width: 100%;">
                <input type="hidden" id="allPage:allForm:allBlock:edmpdDetails:mpdDetailsRecordsCount" value="{!mpdDetailsRecordsCount}" />
                    <table class="list" border="0" cellpadding="0" cellspacing="0">
@@ -1341,7 +1349,7 @@
                                </apex:repeat>
                                <apex:variable var="type" value="" rendered="{!IF(editAble&&!(RecordTypeName='GuranteeMain'&&mpd.Status__c='服务填写'),true,false)}"> 
                                <td class="dataCell" >
                                    <apex:commandButton onclick="deleteJs('{!aa.mpded.id}');return false;" value="删除" style="width:60px" rerender=""/>
                                    <apex:commandButton onclick="deleteJs('{!aa.mpded.id}');" value="删除" style="width:60px" rerender=""/>
                                </td>
                                </apex:variable>
                            </tr>
@@ -1416,9 +1424,91 @@
                            </apex:repeat>
                        </tr>
                        </apex:repeat>
                    </table>
                    </div>
                    </apex:variable>
                    <input type="hidden" id="ProductCnt" value="{!noOfRecords}" />
    <script type="text/javascript">
    function refreshinput1(){
    // 复杂组件 start
    var baseURL = '';
            var ObjectType = 'Maintenance_Product_Data_Details__c';
            var QueryFieldApiName = 'Service_Category6__c';
            var ObjectType = 'Maintenance_Product_Data_Details__c';
            var inputFieldId = '';
            var inputFieldId_lktp = '';
            var SelectObj = 'Service_Category6__c';
            var SelectFld = 'Name';
            console.log('xxx');
            console.log('123');
            var cnt = j$(escapeVfId('ProductCnt')).val();
            console.log('count=' + cnt);
            for (var i = 0; i < cnt; i++) {
                inputFieldId = 'allPage:allForm:allBlock:mpdDetailsSection:save:maintenanceProductDatadetailsTable:'+ i +':theRepeat:13:variable:theValue';
                inputFieldId_lktp = 'allPage:allForm:allBlock:mpdDetailsSection:save:maintenanceProductDatadetailsTable:'+ i +':theRepeat:13:variable:theValue_lktp';
                baseURL = '/apex/SearchContactPageLWC?ObjectType=' + ObjectType + '&QueryFieldApiName=' + QueryFieldApiName +'&QueryFieldApiName=' + QueryFieldApiName +'&ObjectType=' + ObjectType +'&inputFieldId=' + inputFieldId +'&SelectObj=' + SelectObj +'&SelectFld=' + SelectFld;
                var obj = document.getElementById('allPage:allForm:allBlock:mpdDetailsSection:save:maintenanceProductDatadetailsTable:' + i + ':theRepeat:13:variable:theValue_lkwgt');
                if (obj != null) {
                    obj.setAttribute('href', 'javascript:%20openLookup%28%27' + baseURL + '%26lktp%3D%27%20%2B%20getElementByIdCS%28%27' + inputFieldId_lktp + '%27%29.value%2C670%2C%271%27%2C%27%26lksrch%3D%27%20%2B%20escapeUTF%28getElementByIdCS%28%27' + inputFieldId + '%27%29.value.substring%280%2C%2080%29%29%29');
                }
            }
        // 复杂组件 end
    }
    function refreshinput2(){
    // 复杂组件 start
    var baseURL = '';
            var ObjectType = 'Maintenance_Product_Data_Details__c';
            var QueryFieldApiName = 'Service_Category7__c';
            var ObjectType = 'Maintenance_Product_Data_Details__c';
            var inputFieldId = '';
            var inputFieldId_lktp = '';
            var SelectObj = 'Service_Category7__c';
            var SelectFld = 'Name';
            console.log('xxx');
            console.log('123');
            var cnt = j$(escapeVfId('ProductCnt')).val();
            console.log('count=' + cnt);
            for (var i = 0; i < cnt; i++) {
                inputFieldId = 'allPage:allForm:allBlock:mpdDetailsSection:save:maintenanceProductDatadetailsTable:'+ i +':theRepeat:14:variable:theValue';
                inputFieldId_lktp = 'allPage:allForm:allBlock:mpdDetailsSection:save:maintenanceProductDatadetailsTable:'+ i +':theRepeat:14:variable:theValue_lktp';
                baseURL = '/apex/SearchContactPageLWC?ObjectType=' + ObjectType + '&QueryFieldApiName=' + QueryFieldApiName +'&QueryFieldApiName=' + QueryFieldApiName +'&ObjectType=' + ObjectType +'&inputFieldId=' + inputFieldId +'&SelectObj=' + SelectObj +'&SelectFld=' + SelectFld;
                var obj = document.getElementById('allPage:allForm:allBlock:mpdDetailsSection:save:maintenanceProductDatadetailsTable:' + i + ':theRepeat:14:variable:theValue_lkwgt');
                if (obj != null) {
                    obj.setAttribute('href', 'javascript:%20openLookup%28%27' + baseURL + '%26lktp%3D%27%20%2B%20getElementByIdCS%28%27' + inputFieldId_lktp + '%27%29.value%2C670%2C%271%27%2C%27%26lksrch%3D%27%20%2B%20escapeUTF%28getElementByIdCS%28%27' + inputFieldId + '%27%29.value.substring%280%2C%2080%29%29%29');
                }
            }
        // 复杂组件 end
    }
    function refreshinput3(){
    // 复杂组件 start
    var baseURL = '';
            var ObjectType = 'Maintenance_Product_Data_Details__c';
            var QueryFieldApiName = 'Default_Fixture_Arrival_Product__c';
            var ObjectType = 'Maintenance_Product_Data_Details__c';
            var inputFieldId = '';
            var inputFieldId_lktp = '';
            var SelectObj = 'Product2';
            var SelectFld = 'Name';
            console.log('xxx');
            console.log('123');
            var cnt = j$(escapeVfId('ProductCnt')).val();
            console.log('count=' + cnt);
            for (var i = 0; i < cnt; i++) {
                inputFieldId = 'allPage:allForm:allBlock:mpdDetailsSection:save:maintenanceProductDatadetailsTable:'+ i +':theRepeat:4:variable:theValue';
                inputFieldId_lktp = 'allPage:allForm:allBlock:mpdDetailsSection:save:maintenanceProductDatadetailsTable:'+ i +':theRepeat:4:variable:theValue_lktp';
                baseURL = '/apex/SearchContactPageLWC?ObjectType=' + ObjectType + '&QueryFieldApiName=' + QueryFieldApiName +'&QueryFieldApiName=' + QueryFieldApiName +'&ObjectType=' + ObjectType +'&inputFieldId=' + inputFieldId +'&SelectObj=' + SelectObj +'&SelectFld=' + SelectFld;
                var obj = document.getElementById('allPage:allForm:allBlock:mpdDetailsSection:save:maintenanceProductDatadetailsTable:' + i + ':theRepeat:4:variable:theValue_lkwgt');
                if (obj != null) {
                    obj.setAttribute('href', 'javascript:%20openLookup%28%27' + baseURL + '%26lktp%3D%27%20%2B%20getElementByIdCS%28%27' + inputFieldId_lktp + '%27%29.value%2C670%2C%271%27%2C%27%26lksrch%3D%27%20%2B%20escapeUTF%28getElementByIdCS%28%27' + inputFieldId + '%27%29.value.substring%280%2C%2080%29%29%29');
                }
            }
        // 复杂组件 end
    }
    refreshinput1();
    refreshinput2();
    refreshinput3();
    </script>
                </apex:pageBlock>
            </apex:pageBlock>
        </apex:outputPanel>
@@ -1436,5 +1526,85 @@
        </apex:pageBlockTable> 
    </apex:pageBlock>
    <apex:relatedList list="ProcessSteps" rendered="{!!editAble}" ></apex:relatedList>
    <script type="text/javascript">
            //查询参数列表
            let SelectFieldParamList=[
    {
        //原apex:inputField的id值,需要在页面上获取
        inputFieldId : 'allPage:allForm:searchAndMoreUpdate0:RepairInfo14',
        //查找字段所在对象
        ObjectType : 'Maintenance_Product_Data_Details__c',
        //查找字段的api名称
        QueryFieldApiName : 'Service_Category6__c',
        //查找字段的查找对象
        SelectObj : 'Service_Category6__c',
        //搜索时使用的字段
        SelectFld : 'Name',
    },
    {
        //原apex:inputField的id值,需要在页面上获取
        inputFieldId : 'allPage:allForm:searchAndMoreUpdate0:RepairInfo15',
        //查找字段所在对象
        ObjectType : 'Maintenance_Product_Data_Details__c',
        //查找字段的api名称
        QueryFieldApiName : 'Service_Category7__c',
        //查找字段的查找对象
        SelectObj : 'Service_Category7__c',
        //搜索时使用的字段
        SelectFld : 'Name',
    }, {
    //原apex:inputField的id值,需要在页面上获取
    inputFieldId : 'allPage:allForm:searchAndMoreUpdate0:EquipmentInfo5',
    //查找字段所在对象
    ObjectType : 'Maintenance_Product_Data_Details__c',
    //查找字段的api名称
    QueryFieldApiName : 'Default_Fixture_Arrival_Product__c',
    //查找字段的查找对象
    SelectObj : 'Product2',
    //搜索时使用的字段
    SelectFld : 'Name',
    },
    
    ]
    //初始化
    resetOpenPage(SelectFieldParamList);
    </script>
</apex:page>
force-app/main/default/pages/MergeAgencyActivity.page
@@ -23,36 +23,40 @@
<apex:outputPanel id="message">
    <apex:pageMessages />
</apex:outputPanel>
<table>
    <tr>
        <td colspan="2">
            <font>经销商更名</font>
        </td>
    </tr>
    <tr>
        <td>旧经销商管理编码 : </td>
        <td><apex:inputText id="oldAgencyCode" value="{!oldAgencyCode}"/></td>
    </tr>
    <tr>
        <td>新经销商管理编码 : </td>
        <td><apex:inputText id="newAgencyCode" value="{!newAgencyCode}"/></td>
    </tr>
    <tr>
        <td>允许新经销商下存在数据 : </td>
        <td><apex:inputCheckbox id="forceFlg" value="{!forceFlg}"/></td>
    </tr>
    <tr>
        <td><input type="button" value="确定" onclick="startJobJs();return false;" /></td>
    </tr>
    <tr>
        <td colspan="2">
            <apex:outputPanel layout="none" rendered="{!startFlg}">
            <!-- <font>经销商更名</font> -->
                <font>已经开始Batch</font><a href="/apexpages/setup/listAsyncApexJobs.apexp">点此</a><font>查看具体信息</font>
            </apex:outputPanel>
        </td>
    </tr>
</table>
<div style="padding-left: 36%;padding-top: 30px;">
    <table style="height: 200px">
        <tr>
            <td colspan="2">
                <font>经销商更名</font>
            </td>
        </tr>
        <tr>
            <td>旧经销商管理编码 : </td>
            <td><apex:inputText id="oldAgencyCode" value="{!oldAgencyCode}"/></td>
        </tr>
        <tr>
            <td>新经销商管理编码 : </td>
            <td><apex:inputText id="newAgencyCode" value="{!newAgencyCode}"/></td>
        </tr>
        <tr style="height: 38.61px;">
            <td>允许新经销商下存在数据 : </td>
            <td><apex:inputCheckbox id="forceFlg" value="{!forceFlg}"/></td>
        </tr>
        <tr>
            <td></td>
            <td><input type="button" value="确定" onclick="startJobJs();return false;" style="float: right;width: 65%;display: inline-block;height: 30px;border-radius: .25rem;color: rgba(1, 118, 211, 1);background-color: white;border-width: 1px;border-color: rgb(201, 201, 201);border-style: double;" /></td>
        </tr>
        <tr>
            <td colspan="2">
                <apex:outputPanel layout="none" rendered="{!startFlg}">
                <!-- <font>经销商更名</font> -->
                    <font>已经开始Batch</font><a href="/apexpages/setup/listAsyncApexJobs.apexp">点此</a><font>查看具体信息</font>
                </apex:outputPanel>
            </td>
        </tr>
    </table>
</div>
</apex:form>
</apex:page>
force-app/main/default/pages/OFSInsReportLayoutgzw.page
New file
@@ -0,0 +1,789 @@
<apex:page id="Page" showHeader="false" sidebar="false" controller="OFSInsReportLayoutController" applyBodyTag="false" applyHtmlTag="false" action="{!init}" lightningStylesheets="true">
<!-- <apex:page id="Page" showHeader="false" sidebar="false" standardcontroller="Inspection_Item__c" extensions="OFSInsReportLayoutController" applyBodyTag="false" applyHtmlTag="false" action="{!init}"> -->
<html>
<head>
    <meta name="viewport" content="width=1150,user-scalable=yes" />     <!-- TODO 1150はコンテンツの幅 -->
    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
    <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
    <apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
    <apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
    <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
    <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
    <style type="text/css">
        table#AssetTable select {
            width: 98%;
        }
        table#AssetTableHeader .headerCell {
            box-sizing: border-box;
            padding: 2px 1px;
        }
        table#AssetTable .dataCell {
            box-sizing: border-box;
            padding: 1px 1px;
        }
        .bPageBlock .dataCol .requiredInput {
            display: inline-table;
        }
        .bPageBlock .detailList .labelCol {
            width: 1%;
        }
        .dateFormat  {
            display: none;
        }
    </style>
    <script type="text/javascript">
        // function openLookup(){
        //     var baseURL = '';
        //     var ObjectType = 'Inspection_Item__c';
        //     var QueryFieldApiName = 'Product_Manual__c';
        //     var ObjectType = 'Inspection_Item__c';
        //     var inputFieldId = '';
        //     var SelectObj = 'Product2';
        //     var SelectFld = 'Name';
        //     var cnt = j$(escapeVfId('ProductCnt')).val();
        //     for (var i = 0; i < cnt; i++) {
        //         inputFieldId = 'Page:Form:Block:CheckSection:CheckedInfoList:'+i+':Assert';
        //         baseURL = 'apex/SearchContactPageLWC?ObjectType=' + ObjectType + '&QueryFieldApiName=' + QueryFieldApiName +'&QueryFieldApiName=' + QueryFieldApiName +'&ObjectType=' + ObjectType +'&inputFieldId=' + inputFieldId +'&SelectObj=' + SelectObj +'&SelectFld=' + SelectFld;
        //         // var obj = document.getElementById('Page:Form:Block:CheckSection:CheckedInfoList:'+i+':Assert_lkwgt');
        //         // obj.setAttribute('href', baseURL);
        //         openPopup(baseURL, "lookup", 350, 480, "width=700"+",height=480,toolbar=no,status=no,directories=no,menubar=no,resizable=yes,scrollable=no", true);
        //     }
        // }
        var tmpaid = "";
        var tmpan = "";
        var tmpahid = "";
        var tmpahn = "";
        var tmpadid = "";
        var tmpadn = "";
        var tmpaaid = "";
        var tmpaan = "";
        var tmpinsid = "";
        var tmpinsn = "";
        var tmprstr = "";
        sforce.connection.sessionId = '{!$Api.Session_ID}';
        function toggleIrNameDisabled(checker) {
            if (checker.checked) {
                j$(escapeVfId('Page:Form:Block:Ir_Name')).prop("disabled", false);
            } else {
                j$(escapeVfId('Page:Form:Block:Ir_Name')).prop("disabled", true);
            }
        }
        function changeAllCheckResult(val) {
            var cnt = j$(escapeVfId('ProductCnt')).val();
            for (var i = 0; i < cnt; i++) {
                if (val == ' ') {
                    document.getElementById('Page:Form:Block:CheckSection:CheckedInfoList:' + i + ':AssetRowCheckboxIsNormal').value = '';
                } else {
                    document.getElementById('Page:Form:Block:CheckSection:CheckedInfoList:' + i + ':AssetRowCheckboxIsNormal').value = val;
                }
            }
        }
        function clearAndSearch() {
            document.getElementById("Page:Form:Block:UnCheckSection:text1").value = "";
            document.getElementById("Page:Form:Block:UnCheckSection:cond1").value = "equals";
            document.getElementById("Page:Form:Block:UnCheckSection:val1").value = "";
            blockme();
            searchfunc();
        }
        function searchJs() {
            blockme();
            searchfunc();
        }
        function sortTableJs(key) {
            blockme();
            sortTablefunc(key);
        }
        function exchangeAssetJs() {
            blockme();
            exchangeAssetfunc();
        }
        function saveByRepairJs(aid, an, ahid, ahn, adid, adn, aaid, aan, rstr) {
            tmpaid = aid;
            tmpan = an;
            tmpahid = ahid;
            tmpahn = ahn;
            tmpadid = adid;
            tmpadn = adn;
            tmpaaid = aaid;
            tmpaan = aan;
            tmprstr = rstr;
    // 点検報告書変更できなくても、修理を作れる?
    if (tmpinsid == "") {
        blockme();
        saveByRepair();
    } else {
        openRepair();
    }
}
function openRepair() {
    // TODO 今後採番テーブルを使いNameを取得、点検報告書は一時的なものです
    window.open('/a0J/e?retURL=%2F' + tmpaid + '&CF00N10000002Dx66_lkid=' + tmpahid + '&CF00N10000002Dx66=' + encodeURIComponent(tmpahn) + '&CF00N10000002Dx5t_lkid=' + tmpadid + '&CF00N10000002Dx5t=' + encodeURIComponent(tmpadn) + '&CF00N10000002Dx5n_lkid=' + tmpaaid + '&CF00N10000002Dx5n=' + encodeURIComponent(tmpaan) + '&CF00N10000002Dx1X_lkid=' + tmpaid + '&CF00N10000002Dx1X=' + encodeURIComponent(tmpan) + '&00N10000002FH86=' + encodeURIComponent(tmprstr) + '&CF00N10000006PRCp=' + encodeURIComponent(tmpinsn) + '&CF00N10000006PRCp_lkid=' + tmpinsid, '_blank');
}
//add by rentx 20210809 全选功能 start
function checkAll(checker) {
    var cnt = j$(escapeVfId('ProductCnt')).val();
    for (var i = 0; i < cnt; i++) {
        if (j$(escapeVfId('Page:Form:Block:CheckSection:CheckedInfoList:'+i+':AssetRowCheckbox1')).size() == 0) {
            break;
        }
        document.getElementById('Page:Form:Block:CheckSection:CheckedInfoList:'+i+':AssetRowCheckbox1').checked = checker.checked;
    }
}
function checkAll2(checker) {
    var cnt = j$(escapeVfId('ProductCnt2')).val();
    var tempi = parseInt(cnt / 900 )+1;
    for (var j = 0; j < tempi; j++) {
        for (var i = 0; i < 900; i++) {
            if (j$(escapeVfId('Page:Form:Block:UnCheckSection:unCheckedInfoListForThousend:'+j+':UnCheckedInfoList:'+i+':AssetRowCheckbox2')).size() == 0) {
                break;
            }
            document.getElementById('Page:Form:Block:UnCheckSection:unCheckedInfoListForThousend:'+j+':UnCheckedInfoList:'+i+':AssetRowCheckbox2').checked = checker.checked;
        }
    }
}
//add by rentx 20210809 全选功能 end
AWSService.sfSessionId = '{!GETSESSIONID()}';
var staticResource = JSON.parse('{!staticResource}');
var aws_data = {};
var txid = null;
function Encrypt(callback){
    blockme();
    //callback();return;
    //<input type="hidden" value="{!ir.Id}" id="IrId"/>
    let e_id = document.getElementById("IrId");
    let url = staticResource.newUrl;
    aws_data = {
        "phone":j$("[field-api='phone__c']").val(),
        "responsiblePerson":j$("[field-api='Responsible_Person__c']").val(),
    };
    if(e_id && e_id.value){
        url = staticResource.updateUrl;
        aws_data.dataId = document.getElementById("Page:Form:Block:AWS_Data_Id__c").value;
    }
    AWSService.post(url, JSON.stringify([aws_data]), function(data){
        if (!(data && data.object && data.object.length)) {
            console.log('AWSService.post failed');
            return;
        }
        let aws_data1 = data.object[0];
        txid = data.txId;
        document.getElementById("Page:Form:Block:AWS_Data_Id__c").value = aws_data1.dataId;
        j$("[field-api='phone__c']").val(aws_data1.phone);
        j$("[field-api='Responsible_Person__c']").val(aws_data1.responsiblePerson);
        if (callback) {
            callback();
        }
    }, staticResource.token);
}
function saveBtnJs(){
    Encrypt(saveBtn);
}
function submitJs(){
    Encrypt(submit);
}
function showPDFJs(){
    Encrypt(showPDF);
}
function afterSaveBtnJs(){
    Trans();
}
function afterSubmitJs(){
    Trans();
}
function afterShowPDFJs(){
    Trans(function(){
        if (!HasError()) {
            window.location.href = '/apex/InsReportPDFOuter?id=' + document.getElementById("IrId").value;
        }
    });
}
function HasError(){
    // if (IsAddmessage) {
    //     return true;
    // }
    let e = document.getElementById("Page:Form:MessageP");
    if (!e) {
        return false;
    }
    let divs = j$(e).find("div.message");
    for (let i = 0; i < divs.length; i++) {
        for (let j = 0; j < divs[i].classList.length; j++) {
            for(let clsi in divs[i].classList){let cls=divs[i].classList[clsi];
                if (typeof cls == 'string'  && cls.indexOf('error')>-1) {
                    return true;
                }
            }
        }
    }
    return false;
}
function Decrypt(data){
    j$("[field-api='phone__c']").val(data.phone);
    j$("[field-api='Responsible_Person__c']").val(data.responsiblePerson);
}
function Trans(callback){
    let payload = {
        "txId":txid,
        "sfRecordId":document.getElementById("IrId").value,
        "isSuccess":(txid && !HasError()) ? 1 : 0
    };
    AWSService.post(staticResource.transactionUrl, JSON.stringify(payload), function(result){
        Decrypt(aws_data);
        if(callback)callback();
        unblockUI();
    }, staticResource.token);
}
function Query(){
    let ele = document.getElementById("Page:Form:Block:AWS_Data_Id__c");
    if (ele && ele.value) {
        blockme();
        AWSService.query(staticResource.queryUrl, ele.value, function(data){
            if (data && data.object) {
                Decrypt(data.object);
            }
            unblockUI();
        }, staticResource.token);
    }
}
j$(function(){
    Query();
})
</script>
<title>{!ir.Name}</title>
</head>
<body>
    <!-- HWAG-B4Q3G5 20180918Start -->
    <apex:form id="Form" style="margin:0 5px;" onkeydown="if(event.keyCode==13){return false;}">>
    <!-- HWAG-B4Q3G5 20180918End -->
    <script type="text/javascript">
    // 保存後、新規の報告書IDを取得
    tmpinsid = '{!ir.Id}';
    tmpinsn = '{!JSENCODE(ir.Name)}';
    //var IsAddmessage = {IsAddmessage};
    var isPDF = {!isPDF};
</script>
<apex:actionFunction name="searchfunc" action="{!searchBtn}" rerender="Form,Block,UnCheckSection" onComplete="unblockUI();"></apex:actionFunction>
<apex:actionFunction name="exchangeAssetfunc" action="{!exchangeAsset}" rerender="Form" onComplete="unblockUI();"></apex:actionFunction>
<apex:actionFunction name="sortTablefunc" action="{!sortTable}" rerender="Form" onComplete="unblockUI();">
<apex:param name="firstParam" assignTo="{!sortKey}" value="" />
</apex:actionFunction>
<apex:actionFunction name="getAssetFromHp" action="{!getAssetFromHp}" rerender="Form" onComplete="unblockUI();" />
<apex:actionFunction name="saveByRepair" action="{!saveBtn}" rerender="Form" onComplete="unblockUI();openRepair();"/>
<apex:actionFunction name="saveBtn" action="{!saveBtn}" rerender="Form" onComplete="afterSaveBtnJs();"/>
<apex:actionFunction name="submit" action="{!submit}" rerender="Form" onComplete="afterSubmitJs();"/>
<apex:actionFunction name="showPDF" action="{!showPDF}" rerender="Form" onComplete="afterShowPDFJs();"/>
<apex:outputPanel id="MessageP">
<apex:pageMessages />
</apex:outputPanel>
<div><apex:pageBlock mode="maindetail" Id="Block" rendered="{!initFlag}">
    <div style="position: relative;top:0;width:100%;">
        <table>
            <tr>
                <td><apex:outputLabel value="{!$ObjectType.Inspection_Report__c.Label}:" style="font-size:18px;font-weight:bold;padding-right: 5px;"/></td>
                <td>(<apex:inputCheckBox value="{!ir.Name_Manual__c}" id="Name_Manual" onchange="toggleIrNameDisabled(this);return false;"/>
                    <apex:outputLabel value="{!$ObjectType.Inspection_Report__c.fields.Name_Manual__c.Label}" for="Name_Manual"/>)
                    <apex:inputField value="{!ir.Name}" id="Ir_Name" html-disabled="disabled" style="border-width:0px;font-size:18px;font-weight:bold;padding-right:20px;-webkit-text-fill-color:black;"/>
                </td>
                <td style="text-align: center;padding-right: 100px;"><input class="btn" type="Button" style="width:80px;" value="保存" action="" onclick="saveBtnJs();" rerender="Form" onComplete="unblockUI();"/></td>
                <td style="text-align: center;padding-right: 100px;"><input class="btn" type="Button" value="提交" action="" onclick="submitJs();" style="width:80px" rerender="Form" id="submitButton" onComplete="unblockUI();"/></td>
                <td style="text-align: center;padding-right: 100px;"><apex:commandButton style="width:80px;" value="关闭窗口" onclick="location.href='/apex/OFSWindowClose';return false;" id="closeButton"/></td>
                <td style="text-align: center;"><input class="btn" type="Button" style="width:80px;" value="PDF" action="" onclick="showPDFJs();" rerender="Form" onComplete="unblockUI();"/></td>
            </tr>
        </table>
        <apex:pageBlockSection title="{!sectionList[0].title}" columns="{!sectionList[0].column}" showHeader="{!sectionList[0].showHeader}" rendered="{!sectionList.size>0}">
        <apex:repeat value="{!sectionList[0].sectionItemList}" var="sectionItem" id="SectionItemList">
        <apex:outputField value="{!ir[sectionItem.api]}" rendered="{!NOT(sectionItem.isDummy)&&NOT(sectionItem.isCustomize)&&NOT(sectionItem.isInput)}"/>
        <apex:inputField style="width:{!sectionItem.width};height:{!sectionItem.height};" value="{!ir[sectionItem.api]}" rendered="{!NOT(sectionItem.isDummy)&&NOT(sectionItem.isCustomize)&&sectionItem.isInput}" required="{!sectionItem.isRequired}" html-tabindex="{!sectionItem.index}"/>
        <apex:pageblockSectionItem rendered="{!NOT(sectionItem.isDummy)&&(sectionItem.isCustomize)&&Not(isNull(sectionItem.customizeLable))}">
        <apex:outputLabel value="{!sectionItem.customizeLable}"/>
        <apex:outputPanel layout="none">
        <apex:repeat value="{!sectionItem.apiList}" var="api">
        <!-- 保存後、病院は強制outputField -->
        <apex:outputPanel layout="none" rendered="{!api == 'Hospital__c' && ir.Id != ''}">
        <apex:outputField value="{!ir[api]}"/>
    </apex:outputPanel>
    <apex:outputPanel layout="none" rendered="{!NOT(api == 'Hospital__c' && ir.Id != '')}">
    <apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="{!sectionItem.apiLabelMap[api]}"/>
    <apex:inputField value="{!ir[api]}" style="{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && (sectionItem.isInput || sectionItem.apiInputMap[api])}" required="{!sectionItem.apiRequireMap[api]}" html-tabindex="{!sectionItem.index}"/>
    <apex:outputPanel style="display:inline-block;{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && NOT((sectionItem.isInput || sectionItem.apiInputMap[api]))}">
    <apex:outputField value="{!ir[api]}"/>
</apex:outputPanel>
</apex:outputPanel>
</apex:repeat>
</apex:outputPanel>
</apex:pageblockSectionItem>
<apex:pageblockSectionItem rendered="{!NOT(sectionItem.isDummy)&&(sectionItem.isCustomize)&&(isNull(sectionItem.customizeLable))}">
<apex:outputPanel layout="none">
<apex:repeat value="{!sectionItem.apiList}" var="api">
<apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="{!sectionItem.apiLabelMap[api]}"/>
<apex:inputField value="{!ir[api]}" style="{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && (sectionItem.isInput || sectionItem.apiInputMap[api])}" required="{!sectionItem.apiRequireMap[api]}" html-tabindex="{!sectionItem.index}"/>
<apex:outputPanel style="display:inline-block;{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && NOT((sectionItem.isInput || sectionItem.apiInputMap[api]))}">
<apex:outputField value="{!ir[api]}"/>
</apex:outputPanel>
</apex:repeat>
</apex:outputPanel>
</apex:pageblockSectionItem>
<apex:pageBlockSectionItem rendered="{!sectionItem.isDummy}"/>
</apex:repeat>
</apex:pageBlockSection>
</div>
<div style="position: relative;top:0;height:700px;overflow:hidden;overflow-y:auto;-webkit-overflow-scrolling: touch;">
    <input type="hidden" value="{!ir.Id}" id="IrId"/>
    <apex:inputHidden value="{!ir.AWS_Data_Id__c}" id="AWS_Data_Id__c"/>
    <apex:repeat value="{!sectionList}" var="section" id="SectionList">
    <apex:pageBlockSection title="{!section.title}" columns="{!section.column}" showHeader="{!section.showHeader}" rendered="{!!section.isTop}">
    <apex:repeat value="{!section.sectionItemList}" var="sectionItem" id="SectionItemList">
    <apex:outputField value="{!ir[sectionItem.api]}" rendered="{!NOT(sectionItem.isDummy)&&NOT(sectionItem.isCustomize)&&NOT(sectionItem.isInput)}"/>
    <apex:inputField html-field-api="{!sectionItem.api}" style="width:{!sectionItem.width};height:{!sectionItem.height};" value="{!ir[sectionItem.api]}" rendered="{!NOT(sectionItem.isDummy)&&NOT(sectionItem.isCustomize)&&sectionItem.isInput}" required="{!sectionItem.isRequired}" html-tabindex="{!sectionItem.index}"/>
    <apex:pageblockSectionItem rendered="{!NOT(sectionItem.isDummy)&&(sectionItem.isCustomize)&&Not(isNull(sectionItem.customizeLable))}">
    <apex:outputLabel value="{!sectionItem.customizeLable}"/>
    <apex:outputPanel layout="none">
    <apex:repeat value="{!sectionItem.apiList}" var="api">
    <!-- 保存後、病院は強制outputField -->
    <apex:outputPanel layout="none" rendered="{!api == 'Hospital__c' && ir.Id != ''}">
    <apex:outputField value="{!ir[api]}"/>
</apex:outputPanel>
<apex:outputPanel layout="none" rendered="{!NOT(api == 'Hospital__c' && ir.Id != '')}">
<apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="{!sectionItem.apiLabelMap[api]}"/>
<apex:inputField html-field-api="{!api}" value="{!ir[api]}" style="{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && (sectionItem.isInput || sectionItem.apiInputMap[api])}" required="{!sectionItem.apiRequireMap[api]}" html-tabindex="{!sectionItem.index}"/>
<apex:outputPanel style="display:inline-block;{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && NOT((sectionItem.isInput || sectionItem.apiInputMap[api]))}">
<apex:outputField value="{!ir[api]}"/>
</apex:outputPanel>
</apex:outputPanel>
</apex:repeat>
</apex:outputPanel>
</apex:pageblockSectionItem>
<apex:pageblockSectionItem rendered="{!NOT(sectionItem.isDummy)&&(sectionItem.isCustomize)&&(isNull(sectionItem.customizeLable))}">
<apex:outputPanel layout="none">
<apex:repeat value="{!sectionItem.apiList}" var="api">
<apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="{!sectionItem.apiLabelMap[api]}"/>
<apex:inputField html-field-api="api" value="{!ir[api]}" style="{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && (sectionItem.isInput || sectionItem.apiInputMap[api])}" required="{!sectionItem.apiRequireMap[api]}" html-tabindex="{!sectionItem.index}"/>
<apex:outputPanel style="display:inline-block;{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && NOT((sectionItem.isInput || sectionItem.apiInputMap[api]))}">
<apex:outputField value="{!ir[api]}"/>
</apex:outputPanel>
</apex:repeat>
</apex:outputPanel>
</apex:pageblockSectionItem>
<apex:pageBlockSectionItem rendered="{!sectionItem.isDummy}"/>
</apex:repeat>
</apex:pageBlockSection>
</apex:repeat>
<script type="text/javascript">
    // 病院の左側「刷新」ボタン追加
    var labels = document.getElementsByTagName("label");
    for (var i = 0; i < labels.length; i++) {
        var lbl = labels[i];
        if (lbl.innerText == "医院" || lbl.innerText == "病院") {
            var html = lbl.parentNode.innerHTML;
            html = "<input type='button' value='刷新' class='btn' onclick='blockme();getAssetFromHp();' />&nbsp;&nbsp;&nbsp;&nbsp;" + html;
            lbl.parentNode.innerHTML = html;
            break;
        }
    }
</script>
<apex:pageBlockSection title="已选保有设备字段历史" columns="1" id="CheckSection">
<input type="hidden" id="ProductCnt" value="{!productCount}" />
<apex:outputPanel >
<table width="100%">
    <tr>
        <td>&nbsp;</td>
        <td width="100px">
            <span>全</span>
            <select style="vertical-align:text-bottom" id="allCheckResult" size="1" onchange="changeAllCheckResult(this.value);">
                <option value=" ">--无--</option>
                <!-- 默认全OK -->
                <option value="OK" selected = "selected" >OK</option>
                <!-- 默认全OK -->
                <option value="NG">NG</option>
                <!-- add by rentx 20210630 start -->
                <option value="医院放弃">医院放弃</option>
                <!-- add by rentx 20210630 end -->
            </select>
        </td>
        <td width="500px">&nbsp;</td>
    </tr>
</table>
<!-- TODO minus scroll with -->
<table id="AssetTableHeader" class="list" style="border-bottom-width: 0px; font-size:13px;" border="0" cellspacing="0" cellpadding="0">
    <tr style="border-bottom: 1px groove rgba(254, 254, 254, 0.48);background: #f2f3f3;">
        <!-- add by rentx 20210809  -->
        <th class="headerCell" style="width:14px"> <apex:inputCheckbox id="checkAll1" onclick="checkAll(this)" /> </th>
        <!-- <th class="headerCell" style="width:14px" /> -->
        <!-- add by rentx 202120809  -->
        <th class="headerCell" style="width:24px"/>
        <th class="headerCell" style="width:60px">{!$ObjectType.Asset.fields.Asset_situation__c.label}</th>
        <th class="headerCell">{!$ObjectType.Asset.fields.Name.label}</th>
        <th class="headerCell" style="width:100px">{!$ObjectType.Inspection_Item__c.Fields.SerialNumber__c.Label}</th>
        <!-- TODO 項目の作成 -->
        <th class="headerCell" style="width:80px">上次点检日</th>
        <th class="headerCell" style="width:100px">上次修理完毕日</th>
        <th class="headerCell" style="width:80px">
         {!$ObjectType.Inspection_Item__c.Fields.ItemStatus__c.Label}
     </th>
     <th class="headerCell" style="width:100px">{!$ObjectType.Inspection_Item__c.Fields.Fault_Classification1__c.Label}</th>
     <th class="headerCell" style="width:100px">{!$ObjectType.Inspection_Item__c.Fields.Fault_Classification2__c.Label}</th>
     <th class="headerCell" style="width:100px">{!$ObjectType.Inspection_Item__c.Fields.Fault_Classification3__c.Label}</th>
     <th class="headerCell" style="width:100px">{!$ObjectType.Inspection_Item__c.Fields.Diagnosis__c.Label}</th>
     <!-- add by rentx 20210630  -->
     <th class="headerCell" style="width:85px">{!$ObjectType.Inspection_Item__c.Fields.Abandonment_Reasons__c.Label}</th>
     <!-- add by rentx 20210630 -->
     <th class="headerCell" style="width:35px">{!$ObjectType.Asset.Fields.Create_repair__c.Label}</th>
     <!--                                 <td class="headerScroll"></td> -->
 </tr>
</table>
<div style="height:320px; width:100%; overflow:auto;">
    <table style="border-collapse:collapse; width:100%;" id="AssetTable">
        <apex:variable value="{!1}" var="cnt" />
        <apex:repeat value="{!checkedInfoList}" var="cInfo" id="CheckedInfoList" >
        <tr style="border-bottom: 1px groove rgba(254, 254, 254, 0.48);">
            <td style="width:14px">
                <apex:inputCheckbox value="{!cInfo.rec_checkBox_c}" id="AssetRowCheckbox1" rendered="{!Not(cInfo.IsManual)}"/>
                <apex:outputText value="{!cInfo.IsManual}" id="IsManual" style="display:none;" />
                <input type="hidden" value="{!cInfo.rec.Id}" id="CheckAssetId"/>
            </td>
            <td style="font-weight:bold; text-align:right; width:24px;">{!cnt}</td>
            <td class="dataCell" style="width:60px">
                <apex:outputField value="{!cInfo.rec.Asset_situation__c}"/>
            </td>
            <td class="dataCell">
                <!-- HWAG-BDCA9J 添加了 onclick blurProduct 内容 start-->
                <apex:outputField value="{!cInfo.rec.Name}" rendered="{!Not(cInfo.IsManual)}"/>
                <apex:inputField value="{!cInfo.ah.Product_Manual__c}" id="Assert" style="width:90%;" rendered="{!cInfo.IsManual}"
                onclick="if(!blurProduct(this))return false;"/>
                <!-- HWAG-BDCA9J 添加了 onclick  blurProduct 内容 end-->
            </td>
            <td class="dataCell" style="width:100px">
                <apex:outputField value="{!cInfo.ah.SerialNumber__c}" rendered="{!Not(cInfo.IsManual)}"/>
                <apex:inputField value="{!cInfo.ah.SerialNo_Manual__c}" id="SerialNo" style="width:90%;" rendered="{!cInfo.IsManual}" />
            </td>
            <td class="dataCell" style="width:80px">
                <apex:outputField value="{!cInfo.rec.Final_Examination_Date__c}" rendered="{!Not(cInfo.IsManual)}"/>
            </td>
            <td class="dataCell" style="width:100px">
                <apex:outputField value="{!cInfo.rec.After_repair_last_internal_check_day__c}" rendered="{!Not(cInfo.IsManual)}"/>
            </td>
            <td class="dataCell" style="width:80px">
                <apex:inputField value="{!cInfo.ah.ItemStatus__c}" id="AssetRowCheckboxIsNormal" style="width:98%"/>
            </td>
            <td class="dataCell" style="width:100px">
                <apex:inputField value="{!cInfo.ah.Fault_Classification1__c}" />
             </td>
             <td class="dataCell" style="width:100px">
                 <apex:inputField value="{!cInfo.ah.Fault_Classification2__c}" id="cat2" />
             </td>
             <td class="dataCell" style="width:100px">
                 <apex:inputField value="{!cInfo.ah.Fault_Classification3__c}" id="cat3" />
             </td>
             <td class="dataCell" style="width:100px">
                <apex:inputField value="{!cInfo.ah.Diagnosis__c}" style="width:93%"/>
            </td>
            <!-- add by rentx 20210630 -->
            <td class="dataCell" style="width:85px">
                <apex:inputField value="{!cInfo.ah.Abandonment_Reasons__c}"  style="width:93%"   />
            </td>
            <!-- add by rentx 20210630 -->
            <td class="dataCell" style="width:35px">
                <apex:outputPanel layout="none" rendered="{!Not(cInfo.IsManual)}">
                    <a href="#" onclick="saveByRepairJs('{!cInfo.rec.Id}', '{!JSENCODE(cInfo.rec.Name)}', '{!cInfo.rec.Hospital__r.Id}', '{!JSENCODE(cInfo.rec.Hospital__r.Name)}', '{!cInfo.rec.Department_Class__r.Id}', '{!JSENCODE(cInfo.rec.Department_Class__r.Name)}', '{!cInfo.rec.Account.Id}', '{!JSENCODE(cInfo.rec.Account.Name)}', '只修理');">■</a>
                </apex:outputPanel>
            </td>
        </tr>
<apex:variable value="{!cnt + 1}" var="cnt" />
</apex:repeat>
</table>
</div>
</apex:outputPanel>
</apex:pageBlockSection>
<apex:outputPanel id="ButtonPanel">
<table style="width:100%;">
    <tr>
        <td>
            <apex:commandButton value="行追加" action="{!addNewRows}" disabled="{!Not($ObjectType.Inspection_Item__c.createable)}"
            style="margin-left:10px;float:left;" onclick="blockme();" oncomplete="unblockUI();" rerender="Form" />
            <apex:commandButton value="刷新选中的保有设备" onclick="exchangeAssetJs();return false;" rerender="dummy"/>
            <!-- <apex:commandButton value="刷新选中的保有设备" action="{!exchangeAsset}" onclick="blockme();" oncomplete="unblockUI();" rerender="Form" /> -->
            <!--                                 <apex:commandButton value="刷新医院下的全部保有设备" action="{!getAssetFromHp}" onclick="blockme();" oncomplete="unblockUI();" rerender="Form" /> -->
        </td>
    </tr>
</table>
</apex:outputPanel>
<table>
    <tr>
        <td><div id="ErrorName" style="color: red;font-weight: bold;">{!alertMessage}</div>
        </td>
    </tr>
</table>
<!-- HWAG-B4Q3G5 20180918Start -->
<apex:pageBlockSection title="未选保有设备字段历史" columns="1" id="UnCheckSection" onkeydown="if(event.keyCode==13){searchJs(); return false;}">
<!-- HWAG-B4Q3G5 20180918End -->
<input type="hidden" id="ProductCnt2" value="{!productCount2}" />
<apex:outputPanel >
<div align="center">
    <apex:outputPanel id="countorder">第{!countorder}页</apex:outputPanel>
    <apex:commandButton value="上一页" action="{!UpPage}" onclick="blockme();" disabled="{!IF(countorder=1,true,false)}" oncomplete="unblockUI();" reRender="Form"/>
    <apex:commandButton value="下一页" action="{!DownPage}" onclick="blockme();" disabled="{!IF(countorder >=nowAssetcount ,true,false)}" oncomplete="unblockUI();" rerender="Form"/>
    <apex:outputPanel id="NowOrdercount">共{!nowAssetcount}页</apex:outputPanel>
</div>
<table>
    <tr>
        <td style="width:85px" align="right">选择条件</td>
        <td style="width:85px" align="right"><apex:selectList value="{!text1}" id="text1" size="1" style="width:80px"><apex:selectOptions value="{!textOpts}"/></apex:selectList></td>
        <td style="width:85px" align="center"><apex:selectList value="{!cond1}" id="cond1" size="1" style="width:80px"><apex:selectOptions value="{!equalOpts}"/></apex:selectList></td>
        <td style="width:95px" align="left"><apex:inputText value="{!val1}" id="val1" style="width:100px"/></td>
        <td align="left">
            &nbsp;&nbsp;&nbsp;&nbsp;
            <apex:commandButton value="检索" onclick="searchJs();return false;" style="width:130px" rerender="dummy"/>
            &nbsp;&nbsp;
            <apex:commandButton value="清除条件" onclick="clearAndSearch();" style="width:130px" rerender="dummy"/>
            &nbsp;&nbsp;
            <span style="vertical-align: text-bottom;">使用中<apex:inputCheckBox value="{!activeOn}" /></span>
        </td>
    </tr>
</table>
<table style="border-collapse:collapse;" id="AssetTable2">
    <tr style="border-bottom: 1px groove rgba(254, 254, 254, 0.48);background: #f2f3f3;">
        <!-- add by rentx 20210809 start 全选功能  -->
        <!-- <th class="headerCell" style="width:25px"></th> -->
        <th class="headerCell" style="padding: 2px 5px; width:25px"><apex:inputCheckbox id="checkAll1" onclick="checkAll2(this)" /> </th>
        <!-- add by rentx 20210809 end 全选功能  -->
        <th class="headerCell" style="width:70px">
            <a href="#" onclick="sortTableJs('0');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Asset_situation__c.label}</a>{!sortOrder[0]}
        </th>
        <th class="headerCell">
            <a href="#" onclick="sortTableJs('1');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Name.label}</a>{!sortOrder[1]}
        </th>
        <th class="headerCell" style="width:70px">
            <a href="#" onclick="sortTableJs('2');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.SerialNumber.label}</a>{!sortOrder[2]}
        </th>
        <th class="headerCell" style="width:70px">
            <a href="#" onclick="sortTableJs('3');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.CurrentContract__c.label}</a>{!sortOrder[3]}
        </th>
        <th class="headerCell" style="width:70px">
            <a href="#" onclick="sortTableJs('4');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Department_Name__c.label}</a>{!sortOrder[4]}
        </th>
        <th class="headerCell" style="width:70px">
            <a href="#" onclick="sortTableJs('5');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Status.label}</a>{!sortOrder[5]}
        </th>
        <th class="headerCell" style="width:90px">
            <a href="#" onclick="sortTableJs('6');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Installation_Site__c.label}</a>{!sortOrder[6]}
        </th>
        <th class="headerCell" style="width:90px">
            <a href="#" onclick="sortTableJs('7');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Room_Number__c.label}</a>{!sortOrder[7]}
        </th>
        <th class="headerCell" style="width:90px">
            <a href="#" onclick="sortTableJs('8');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.InstallDate.label}</a>{!sortOrder[8]}
        </th>
        <th class="headerCell" style="width:90px">
            <a href="#" onclick="sortTableJs('9');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Asset_Owner__c.label}</a>{!sortOrder[9]}
        </th>
        <th class="headerCell" style="width:90px">
            <a href="#" onclick="sortTableJs('10');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Accumulation_Repair_Amount__c.label}</a>{!sortOrder[10]}
        </th>
    </tr>
    <apex:variable value="{!1}" var="cnt" />
    <apex:variable value="{!0}" var="cntOut" />
    <apex:repeat value="{!IF(ThousandFLG>0,unCheckedInfoListForThousend,1)}" var="Thoinfo" id="unCheckedInfoListForThousend">
    <apex:repeat value="{!IF(ThousandFLG>0,Thoinfo,unCheckedInfoList)}" var="ucInfo" id="UnCheckedInfoList" >
    <tr style="border-bottom: 1px groove rgba(254, 254, 254, 0.48);">
        <td style="padding: 2px 5px; width:25px">
            <apex:inputCheckbox value="{!ucInfo.rec_checkBox_c}" id="AssetRowCheckbox2"/>
            <input type="hidden" value="{!ucInfo.rec.Id}" id="UncheckAssetId"/>
        </td>
        <td style="padding: 2px 5px; width:70px">
            <apex:outputField value="{!ucInfo.rec.Asset_situation__c}"/>
        </td>
        <td style="padding: 2px 5px;">
            <a href="#" onclick="window.open('/{!ucInfo.rec.Id}', '_blank');">{!ucInfo.rec.Name}</a>
            <!--                                     <apex:outputField value="{!ucInfo.rec.name}" id="assetName"/> -->
        </td>
        <td style="padding: 2px 5px; width:70px">
            <apex:outputField value="{!ucInfo.rec.SerialNumber}"/>
        </td>
        <td style="padding: 2px 5px; width:70px">
            <!--                                     <apex:outputField value="{!ucInfo.rec.CurrentContract__c}"/> -->
            <a href="#" onclick="window.open('/{!ucInfo.rec.CurrentContract__c}', '_blank');">{!ucInfo.rec.CurrentContract__r.Management_Code__c}</a>
        </td>
        <td style="padding: 2px 5px; width:70px">
            <apex:outputField value="{!ucInfo.rec.Department_Name__c}"/>
        </td>
        <td style="padding: 2px 5px; width:70px">
            <apex:outputField value="{!ucInfo.rec.Status}"/>
        </td>
        <td style="padding: 2px 5px; width:70px">
            <apex:outputField value="{!ucInfo.rec.Installation_Site__c}"/>
        </td>
        <td style="padding: 2px 5px; width:70px">
            <apex:outputField value="{!ucInfo.rec.Room_Number__c}"/>
        </td>
        <td style="padding: 2px 5px; width:90px;text-align:center">
            <apex:outputField value="{!ucInfo.rec.InstallDate}"/>
        </td>
        <td style="padding: 2px 5px; width:90px">
            <apex:outputField value="{!ucInfo.rec.Asset_Owner__c}"/>
        </td>
        <td style="padding: 2px 5px; width:90px;text-align:center">
            <apex:outputField value="{!ucInfo.rec.Accumulation_Repair_Amount__c}"/>
        </td>
    </tr>
    <apex:variable value="{!cnt + 1}" var="cnt" />
</apex:repeat>
<apex:variable value="{!cntOut + 1}" var="cntOut" />
</apex:repeat>
</table>
</apex:outputPanel>
</apex:pageBlockSection>
<!-- fxk 2021/8/4 新加 Start-->
<apex:pageBlockSection title="打印时洗消信息" columns="1" id="UnCheckSection1" >
<apex:outputPanel >
<table class="edittable" border="0" style="border-collapse: collapse; width:600px; table-layout:fixed;">
    <tr>
        <td>{!$ObjectType.Inspection_Report__c.fields.CleaningFluid__c.Label}:</td>
        <td><apex:inputField value="{!ir.CleaningFluid__c}" style="width: 90%"/></td>
        <!-- 方式  add by rentx 20210927 start-->
        <td>{!$ObjectType.Inspection_Report__c.fields.Mode__c.Label}:</td>
        <td><apex:inputField value="{!ir.Mode__c}" style="width: 90%"/></td>
        <!-- 方式 add by rentx 20210927 end -->
        <td>{!$ObjectType.Inspection_Report__c.fields.SterilizationMethod__c.Label}:</td>
        <td><apex:inputField value="{!ir.SterilizationMethod__c}" style="width: 90%"/></td>
        <td>{!$ObjectType.Inspection_Report__c.fields.Remarks__c.Label}:</td>
        <td><apex:inputText value="{!ir.Remarks__c}" style="width: 90%"/></td>
    </tr>
    <tr>
        <td>{!$ObjectType.Inspection_Report__c.fields.Disinfectant__c.Label}:</td>
        <td><apex:inputField value="{!ir.Disinfectant__c}" style="width: 90%"/></td>
        <td>{!$ObjectType.Inspection_Report__c.fields.UsedMachine__c.Label}:</td>
        <td><apex:inputField value="{!ir.UsedMachine__c}" style="width: 90%"/></td>
        <td>{!$ObjectType.Inspection_Report__c.fields.Used_ET__c.Label}:</td>
        <td><apex:inputText value="{!ir.Used_ET__c}" style="width: 90%"/></td>
    </tr>
</table>
</apex:outputPanel>
</apex:pageBlockSection>
<!-- fxk 2021/8/4 新加 End-->
</div>
</apex:pageBlock></div>
<script type="text/javascript">
    // 已签字の場合、変更不能にする
    var status = '{!ir.Status__c}';
    if (status == "申请中" || status == "批准") {
        var inputs = document.getElementsByTagName("input");
        for (var i = 0; i < inputs.length; i++) {
            var obj = inputs[i];
            if (obj.id == "Page:Form:Block:closeButton") continue;
            //if (obj.id == "Page:Form:Block:submitButton") continue;
            //if (status == "已签字" && obj.id == "Page:Form:Block:submitButton") continue;
            if (obj.type == "button") {
                setButtonDisable(obj, true);
            } else {
                obj.disabled = true;
            }
        }
        var selects = document.getElementsByTagName("select");
        console.log(selects);
        for (var i = 0; i < selects.length; i++) {
            selects[i].disabled = true;
        }
    } else {
        //var smb = j$(escapeVfId("Page:Form:Block:submitButton"))[0];
        //setButtonDisable(smb, true);
    }
    // HWAG-BDCA9J 提醒未保存和刷新前不能选择产品 start
    function blurProduct(obj) {
        var irID = "{!ir.Id}";
        var productCount2 = "{!productCount2}";
        if(!irID && productCount2  == 0){
            alert('请先输入医院并点击刷新按钮调出保有设备,否则点检结果无法与设备关联。');
            obj.blur();
            return false;
        }
        return true;
    }
    // HWAG-BDCA9J 提醒未保存和刷新前不能选择产品 end
    // 复杂组件 start
        var baseURL = '';
        var ObjectType = 'Inspection_Item__c';
        var QueryFieldApiName = 'Product_Manual__c';
        var ObjectType = 'Inspection_Item__c';
        var inputFieldId = '';
        var inputFieldId_lktp = '';
        var SelectObj = 'Product2';
        var SelectFld = 'Name';
        var cnt = j$(escapeVfId('ProductCnt')).val();
        for (var i = 0; i < cnt; i++) {
            inputFieldId = 'Page:Form:Block:CheckSection:CheckedInfoList:'+i+':Assert';
            inputFieldId_lktp = 'Page:Form:Block:CheckSection:CheckedInfoList:'+i+':Assert_lktp';
            baseURL = '/apex/SearchContactPageLWC?ObjectType=' + ObjectType + '&QueryFieldApiName=' + QueryFieldApiName +'&QueryFieldApiName=' + QueryFieldApiName +'&ObjectType=' + ObjectType +'&inputFieldId=' + inputFieldId +'&SelectObj=' + SelectObj +'&SelectFld=' + SelectFld;
            var obj = document.getElementById('Page:Form:Block:CheckSection:CheckedInfoList:'+i+':Assert_lkwgt');
            if (obj != null) {
                obj.setAttribute('href', 'javascript:%20openLookup%28%27' + baseURL + '%26lktp%3D%27%20%2B%20getElementByIdCS%28%27' + inputFieldId_lktp + '%27%29.value%2C670%2C%271%27%2C%27%26lksrch%3D%27%20%2B%20escapeUTF%28getElementByIdCS%28%27' + inputFieldId + '%27%29.value.substring%280%2C%2080%29%29%29');
            }
        }
    // 复杂组件 end
    // }
</script>
</apex:form>
</body>
</html>
</apex:page>
force-app/main/default/pages/OFSInsReportLayoutgzw.page-meta.xml
New file
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexPage xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>41.0</apiVersion>
    <availableInTouch>false</availableInTouch>
    <confirmationTokenRequired>false</confirmationTokenRequired>
    <label>OFSInsReportLayoutgzw</label>
</ApexPage>
force-app/main/default/pages/PCLLostReportPageLwc.page
@@ -1,7 +1,19 @@
<apex:page lightningStylesheets="true">
    <apex:includeLightning />
    <div id="vfContainer"></div>
    <div id="vfContainer" style="-webkit-overflow-scrolling: touch;overflow-y: scroll;"></div>
    <style>
        label {
        color: black !important;
        }
        .aura-error-message {
            display: none;
        }
        .slds-theme_error{
            --slds-g-color-error-base-40: #ba0517 !important;
            --lwc-colorBackgroundToastError: #ba0517 !important;
        }
    </style>
    <script>
        init();
        function init(){
@@ -20,6 +32,13 @@
                },
                "vfContainer",
                function(cmp) {
                    var errorMessageElement = document.getElementById('auraErrorMessage');
                    // 检查是否找到了元素
                    if (errorMessageElement) {
                        // 隐藏元素
                        errorMessageElement.style.display = 'none';
                    }
                }
            );
            });
force-app/main/default/pages/searchAimsAccount.page
@@ -5,6 +5,8 @@
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
<apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
<!-- <apex:stylesheet value="{!URLFOR($Resource.StyleUtilCss)}"/> -->
<!-- <apex:stylesheet value="{!URLFOR($Resource.StyleUtilColorCss)}"/> -->
    <script>
    function setProductOne(name,id) {
       
@@ -21,7 +23,7 @@
        </apex:outputPanel>
        <apex:form id="mainForm">
            <apex:pageBlock id="idSearchSetProduct" title="特价医院选择">
                <table width="750" border="0">
                <table width="750" border="0" style="background-color:#DCDCDC">
                    <colgroup>
                        <col width="12" />
                        <col width="20" />
@@ -32,7 +34,7 @@
                    </colgroup>
                    <tr>
                        <td>&nbsp;</td>
                        <th style="width:7%">{!$Label.Search_Condition}</th>
                        <th style="width:100px;">{!$Label.Search_Condition}</th>
                        <td>&nbsp;</td>
                        <th>医院名称</th>
                        <td>&nbsp;</td>
@@ -43,25 +45,24 @@
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td><apex:inputText id="searchName" value="{!SearchName}" style="width:200px" required="false"/></td>
                        <td>&nbsp;</td>
                        <td><apex:commandButton value="{!$Label.Search}" action="{!serContact}" style="width:100px" /></td>
                        <td><apex:commandButton value="{!$Label.Search}" action="{!serContact}" style="width:100px;margin-left: 20px;" /></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td colspan="15">&nbsp;</td>
                        <td style="solid #888;" colspan="15">&nbsp;</td>
                    </tr>
                </table>
                <table width="750" border="0">
                <table width="750" border="0" style="background-color:#DCDCDC">
                    <tr>
                        <td width="12">&nbsp;</td>
                        <th valign="top">{!$Label.Search_Result}</th>
                        <td width="20">&nbsp;</td>
                        <td>
                            <table border="0">
                            <table border="0" style="border-left: 0px;border-right: 0px;">
                                <tr>
                                    <td>
                                    <div id="iframelike" style="width:750">
                                    <apex:pageBlockTable id="idRezultVisitor" value="{!at}" var="c" border="0" columns="3" columnsWidth="200px,100px,350px">
                                    <div id="iframelike" style="width:665px">
                                    <apex:pageBlockTable style="border-left: 0px;border-right: 0px;" id="idRezultVisitor" value="{!at}" var="c" border="1" columns="3" columnsWidth="200px,100px,350px">
                                        <apex:column >
                                            <apex:facet name="header">医院名称</apex:facet>
                                            <apex:outputLink id="contactName" value="{!c.Name}" onclick="setProductOne('{!c.Name}','{!c.Id}');return false;">{!c.Name}</apex:outputLink>
force-app/main/default/pages/taskManage.page
@@ -14,4 +14,18 @@
 });
 });
 </script>
 <style>
    .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;
    }
 </style>
</apex:page>
force-app/main/default/staticresources/blockUIcss.css
@@ -26,4 +26,19 @@
    top:0px;
    z-index:100;
    background-color:#000000;
}
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: 0 auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
force-app/main/default/triggers/AttachmentTrigger.trigger
@@ -576,7 +576,7 @@
                    oFOrder.LatestUploadUser__c = null;
                    oFOrder.LatestUploadTime__c = null;
                }
            }、
            }
            update oFOrderList;
force-app/main/default/triggers/ContentDocumentLink.trigger
@@ -1,4 +1,31 @@
trigger ContentDocumentLink on ContentDocumentLink (before insert,after insert,after delete, before update, after update) {
trigger ContentDocumentLink on ContentDocumentLink (before insert,after insert,before delete) {
    if(StaticParameter.ContentDocumentLink == false){
        return;
    }
    if((!Test.isRunningTest())&&UserInfo.getUserId()==System.Label.ByPassTrigger){
        return;
    }
//     if (Trigger.isAfter && Trigger.isInsert) {
//         Set<Id> Ids = new Set<id>();
//         Map<Id,ContentDocumentLink> mapcvwithid = new Map<Id,ContentDocumentLink>();
//         for(ContentDocumentLink c:Trigger.new){
//         ids.add(c.ContentDocumentId);
//         mapcvwithid.put(c.ContentDocumentId,c);
//         }
//     if(ids.size() >  0){
//         for(ContentDocument ContentDocumentObj : [select id,FileType from ContentDocument where id in: ids]){
//             if(mapcvwithid.get(ContentDocumentObj.Id).LinkedEntityId != null && ContentDocumentObj.FileType != null){
//                 String ObjectName = mapcvwithid.get(ContentDocumentObj.Id).LinkedEntityId.getSObjectType().getDescribe().getName();
//                 String filetype = ContentDocumentObj.FileType.toLowerCase();
//                 String CsName = ObjectName+'-'+filetype;
//                     ContentDocumentLink ContentDocumentLinkObj = mapcvwithid.get(ContentDocumentObj.Id);
//                     ContentDocumentLinkObj.addError('Testing error');
//                     return;
//             }
//         }
//     }
// }
    List<String> rentalIds = new List<String>();
    List<String> attIds = new List<String>();
    List<String> rentalApplyIds = new List<String>();
@@ -44,7 +71,23 @@
            }
        }
    }
    if (Trigger.isBefore && Trigger.isDelete) {
        for (ContentDocumentLink link : Trigger.old) {
            if (String.valueOf(link.LinkedEntityId).startsWith('001')) {
                accIds.add(link.LinkedEntityId);
            }
            // LHJ CHAN-BCLD4P 20190618 Start
            if(String.valueOf(link.LinkedEntityId).startsWith(System.Label.OppSpecialApply)){
                specIds.add(link.LinkedEntityId);
            }
            // LHJ CHAN-BCLD4P 20190618 End
            //20221014 yc 医院审批优化 start
            if (String.valueOf(link.LinkedEntityId).startsWith('a5C') || String.valueOf(link.LinkedEntityId).startsWith('a5A')) {
                accAppIds.add(link.LinkedEntityId);
            }
            //20221014 yc 医院审批优化 end
        }
    }
    //CHAN-BCNCRB ---XHL----End-----
    if (Trigger.isAfter && Trigger.isInsert) {
        List<Id> idList = new List<Id>();
@@ -109,23 +152,6 @@
        }
    }
    if (Trigger.isAfter && Trigger.isDelete) {
        for (ContentDocumentLink link : Trigger.old) {
            if (String.valueOf(link.LinkedEntityId).startsWith('001')) {
                accIds.add(link.LinkedEntityId);
            }
            // LHJ CHAN-BCLD4P 20190618 Start
            if(String.valueOf(link.LinkedEntityId).startsWith(System.Label.OppSpecialApply)){
                specIds.add(link.LinkedEntityId);
            }
            // LHJ CHAN-BCLD4P 20190618 End
            //20221014 yc 医院审批优化 start
            if (String.valueOf(link.LinkedEntityId).startsWith('a5C') || String.valueOf(link.LinkedEntityId).startsWith('a5A')) {
                accAppIds.add(link.LinkedEntityId);
            }
            //20221014 yc 医院审批优化 end
        }
    }
    
    //2023-2-10  sx备品 备品检测分析报告 start
@@ -209,10 +235,20 @@
            if(accList.size() > 0){
                // Account acc = new Account(Id = accid);
                //20221207 lt 医院审批优化 start
                for(Account acc : accList){
                    if(Trigger.isDelete && (Trigger.isAfter)){
                for(Account acc : accList){
                    if(Trigger.isUpdate && Trigger.isAfter){
                        for(ContentDocumentLink link : Trigger.New){
                            if(attMap.containsKey(link.LinkedEntityId) &&acc.Is_Active__c != '草案中'){
                                System.debug('lt123---草案中---');
                                link.addError('非草案中,附件不允许编辑。');
                                return;
                            }
                        }
                    }
                    if(Trigger.isDelete && (Trigger.isBefore)){
                        for(ContentDocumentLink link : Trigger.old){
                            // if(attMap.containsKey(att.ParentID) && acc.Is_Active__c != '草案中'){
                            if(acc.Is_Active__c != '草案中'){
                                link.addError('非草案中,附件不允许删除。');
                
@@ -232,7 +268,10 @@
        //     acc.Is_upload_file__c = attMap.containsKey(accid);
        //     updAccList.add(acc);
        // }
        if (updAccList.size() > 0) update updAccList;
        if (updAccList.size() > 0){
            StaticParameter.ContentDocumentTrigger = false;
            update updAccList;
        }
    }
    //20221014 yc 医院审批优化 start
@@ -268,6 +307,7 @@
            
        }
        try {
            System.debug('客户变更申请');
            if (updAccAppList.size() > 0) update updAccAppList; 
        } catch (Exception e) {
            linkList[0].addError(e.getMessage());
@@ -328,18 +368,19 @@
                    ofc.Last_upload_user__c = UserInfo.getUserId();
                    ofc.Last_upload_time__c = System.now();
                    System.debug(ofc+'23333');
                    update OpporList;
                }else{
                    OpporFileUndeleteMap.put(ofc.id,ofc.id);
                    System.debug(ofc+'23333444444');
                }
            }
            update OpporList;
        }
    }
    System.debug(Trigger.isDelete+'Trigger.isDelete');
    System.debug(Trigger.isBefore+'Trigger.isBefore');
   
    if(Trigger.isDelete && Trigger.isAfter){
    if(Trigger.isDelete && Trigger.isBefore){
        for(ContentDocumentLink link : Trigger.old){
            if(OpporFileUndeleteMap.containsKey(link.LinkedEntityId)){
                link.addError('备货已审批,不可删除附件');
@@ -365,68 +406,75 @@
            }
        }
    }
    // List<Attachment> atcList = [select id,ParentId,createddate,createdbyid from Attachment where ParentId in:DeleteReIds];
    List<ContentDocumentLink> linkList = [select ContentDocumentId from ContentDocumentLink where LinkedEntityId in:DeleteReIds];
    List<Id> idList = new List<Id>();
    for (ContentDocumentLink link : linkList) {
        idList.add(link.ContentDocumentId);
    }
    List<ContentDocument> docList = [select Id,ArchivedDate,ArchivedById from ContentDocument where Id =: idList];
    System.debug(DeleteReIds+'222222222222');
    if(docList.size()>0){
        for(String ids : DeleteReIds){
            for(ContentDocument doc : docList){
                if(OppordeleteReTimeMap.containsKey(ids)){
                    if(doc.ArchivedDate > OppordeleteReTimeMap.get(ids)){
                        OppordeleteReTimeMap.put(ids,doc.ArchivedDate);
                        OppordeleteReUserMap.put(ids,doc.ArchivedById);
    if(DeleteReIds.size() > 0){
        // List<Attachment> atcList = [select id,ParentId,createddate,createdbyid from Attachment where ParentId in:DeleteReIds];
        List<ContentDocumentLink> linkList = [select LinkedEntityId,ContentDocumentId from ContentDocumentLink where LinkedEntityId in:DeleteReIds];
        List<Id> idList = new List<Id>();
        for (ContentDocumentLink link : linkList) {
            if(link.LinkedEntityId.getSObjectType().getDescribe().getName() != 'User'){
                idList.add(link.ContentDocumentId);
            }
        }
        List<ContentDocument> docList = [select Id,CreatedDate,CreatedById from ContentDocument where Id =: idList];
        System.debug(DeleteReIds+'222222222222');
        System.debug(docList + 'doclist');
        if(docList.size()>0){
            for(String ids : DeleteReIds){
                for(ContentDocument doc : docList){
                    if(OppordeleteReTimeMap.containsKey(ids)){
                        if(doc.CreatedDate > OppordeleteReTimeMap.get(ids)){
                            OppordeleteReTimeMap.put(ids,doc.CreatedDate);
                            OppordeleteReUserMap.put(ids,doc.CreatedById);
                        }else{
                            continue;
                        }
                    }else{
                        continue;
                        OppordeleteReTimeMap.put(ids,doc.CreatedDate);
                        OppordeleteReUserMap.put(ids,doc.CreatedById);
                    }
                }else{
                    OppordeleteReTimeMap.put(ids,doc.ArchivedDate);
                    OppordeleteReUserMap.put(ids,doc.ArchivedById);
                }
            }
        }
        List<Opportunity_File__c> reDateList = [select id,Last_upload_time__c,
                                                                Is_Locked__c,
                                                                Last_upload_user__c
                                                            from Opportunity_File__c
                                                            where id
                                                            in:DeleteReIds ];
        if(reDateList.size()>0){
            for(Opportunity_File__c ofc : reDateList){
                ofc.Last_upload_time__c = OppordeleteReTimeMap.get(ofc.id);
                ofc.Last_upload_user__c = OppordeleteReUserMap.get(ofc.id);
                System.debug(ofc+'233333333');
            }
            if(Trigger.isInsert && Trigger.isAfter){
                update reDateList;
            }
        }
    }else{
        List<Opportunity_File__c> reDateList = [select id,Last_upload_time__c,
                                                                Is_Locked__c,
                                                                Last_upload_user__c
                                                            from Opportunity_File__c
                                                            where id
                                                            in:DeleteReIds ];
        if(reDateList.size()>0){
            for(Opportunity_File__c ofc : reDateList){
                if (!ofc.Is_Locked__c) {
                    ofc.Last_upload_time__c = null;
                    ofc.Last_upload_user__c = null;
            System.debug(OppordeleteReTimeMap + 'OppordeleteReTimeMap');
            System.debug(OppordeleteReUserMap + 'OppordeleteReUserMap');
            List<Opportunity_File__c> reDateList = [select id,Last_upload_time__c,
                                                                    Is_Locked__c,
                                                                    Last_upload_user__c
                                                                from Opportunity_File__c
                                                                where id
                                                                in:DeleteReIds ];
            if(reDateList.size()>0){
                for(Opportunity_File__c ofc : reDateList){
                    ofc.Last_upload_time__c = OppordeleteReTimeMap.get(ofc.id);
                    ofc.Last_upload_user__c = OppordeleteReUserMap.get(ofc.id);
                    System.debug(ofc+'233333333');
                }
                if(Trigger.isInsert && Trigger.isAfter){
                    update reDateList;
                }
                
            }
        }else{
            List<Opportunity_File__c> reDateList = [select id,Last_upload_time__c,
                                                                    Is_Locked__c,
                                                                    Last_upload_user__c
                                                                from Opportunity_File__c
                                                                where id
                                                                in:DeleteReIds ];
            if(reDateList.size()>0){
                for(Opportunity_File__c ofc : reDateList){
                    if (!ofc.Is_Locked__c) {
                        ofc.Last_upload_time__c = null;
                        ofc.Last_upload_user__c = null;
                        update reDateList;
                    }
                }
            }
        }
    }
    //CHAN-BCNCRB ---XHL----Start-----
    if (opportunity_FileIds.size() > 0) {
@@ -502,7 +550,7 @@
        if (oFOrderList.size() > 0 ) {
            for (OpportunityFileOrder__c oFOrder :oFOrderList) {
                System.debug(oFOrderIdMap.get(oFOrder.Id));
                if (oFOrderIdMap.get(oFOrder.Id)) {
                    oFOrder.LatestUploadUser__c = UserInfo.getUserId();
                    oFOrder.LatestUploadTime__c = System.now();
force-app/main/default/triggers/ContentDocumentTrigger.trigger
@@ -1,14 +1,24 @@
trigger ContentDocumentTrigger on ContentDocument (before delete) {
trigger ContentDocumentTrigger on ContentDocument (before delete,before update) {
    if(StaticParameter.ContentDocumentTrigger == false){
        return;
    }
    if((!Test.isRunningTest())&&UserInfo.getUserId()==System.Label.ByPassTrigger){
        return;
    }
    // LHJ CHAN-BCLD4P 20190618 Start
    List<String> specIds = new List<String>();
    // LHJ CHAN-BCLD4P 20190618 End
    System.debug('enter ContentDocumentTrigger');
    List<String> rentaldelIds = new List<String>();
    List<String> attdelIds = new List<String>();
    // LHJ CHAN-BCLD4P 20190618 Start
    List<String> specDelIds = new List<String>();
    // LHJ CHAN-BCLD4P 20190618 End
    List<String> accIds = new List<String>();
    //20221014 yc 医院审批优化 start
    List<String> accAppIds = new List<String>();
    //20221014 yc 医院审批优化 end
    List<String> OpporFileIds = new List<String>();
    Map<String,String> OpporFileUndeleteMap = new Map<String,String>();
    List<String> DeleteReIds = new List<String>();
@@ -28,8 +38,45 @@
    String invoiceStart = System.Label.invoiceStart;
    List<String> rentaldelIdsZhj = new List<String>();
    List<String> attdelIdsZhj = new List<String>();
    if (Trigger.isBefore && Trigger.isUpdate) {
        List<Id> idList = new List<Id>();
        for(ContentDocument doc: Trigger.old){
            idList.add(doc.Id);
        }
        List<ContentDocumentLink> linkList = [select LinkedEntityId from ContentDocumentLink where ContentDocumentId in: idList];
        for (ContentDocumentLink link : linkList) {
            if (String.valueOf(link.LinkedEntityId).startsWith('a5C') || String.valueOf(link.LinkedEntityId).startsWith('a5A')) {
                accAppIds.add(link.LinkedEntityId);
            }
            if (String.valueOf(link.LinkedEntityId).startsWith('001')) {
                accIds.add(link.LinkedEntityId);
            }
        }
    }
    if (Trigger.isBefore && Trigger.isDelete) {
        List<Id> idList = new List<Id>();
        for(ContentDocument doc: Trigger.old){
            idList.add(doc.Id);
        }
        List<ContentDocumentLink> linkList = [select LinkedEntityId from ContentDocumentLink where ContentDocumentId in: idList];
        System.debug('Link的条数:' + linkList.size());
        for (ContentDocumentLink link : linkList) {
            if (String.valueOf(link.LinkedEntityId).startsWith('001')) {
                accIds.add(link.LinkedEntityId);
            }
            // LHJ CHAN-BCLD4P 20190618 Start
            if(String.valueOf(link.LinkedEntityId).startsWith(System.Label.OppSpecialApply)){
                specIds.add(link.LinkedEntityId);
            }
            // LHJ CHAN-BCLD4P 20190618 End
            //20221014 yc 医院审批优化 start
            if (String.valueOf(link.LinkedEntityId).startsWith('a5C') || String.valueOf(link.LinkedEntityId).startsWith('a5A')) {
                accAppIds.add(link.LinkedEntityId);
            }
            //20221014 yc 医院审批优化 end
        }
        for (ContentDocument cd : Trigger.old) {
            System.debug('cd.Id = ' + cd.Id);
            List<ContentDocumentLink> cdlList = [SELECT id, LinkedEntityId FROM ContentDocumentLink WHERE ContentDocumentId = :cd.Id];
@@ -69,51 +116,69 @@
        for (ContentDocument doc : Trigger.old) {
            idList.add(doc.Id);
        }
        List<ContentDocumentLink> link = [select LinkedEntityId from ContentDocumentLink where ContentDocumentId in: idList limit 1];
        List<ContentDocumentLink> linkList = [select ContentDocumentId,LinkedEntityId from ContentDocumentLink where ContentDocumentId in: idList];
        List<ContentVersion> version = [select Id from ContentVersion where ContentDocumentId in: idList];
        System.debug('Version的条数:' + version.size());
        Id cid;
        ContentDocumentLink link;
        for(ContentDocumentLink lin: linkList){
            System.debug('...' + lin.LinkedEntityId.getSObjectType().getDescribe().getName());
            if(lin.LinkedEntityId.getSObjectType().getDescribe().getName() != 'User'){
                cid = lin.LinkedEntityId;
                link = lin;
            }
        }
        if(cid == null){
            return;
        }
        for (ContentDocument doc : Trigger.old) {
            //if (att.Name.toUpperCase() == '合同书.PDF' && String.valueOf(att.ParentId).startsWith('a0t')) {
            // 添付した契約書のファイル名は指定できない
            if (String.valueOf(link[0].LinkedEntityId).startsWith('a2K')) {
                rentaldelIds.add(link[0].LinkedEntityId);
            if (String.valueOf(cid).startsWith('a2K')) {
                rentaldelIds.add(cid);
                attdelIds.add(version[0].Id);
            }
            if(String.valueOf(link[0].LinkedEntityId).startsWith(System.Label.Oppor_sepKey)){
                OpporFileIds.add(link[0].LinkedEntityId);
            if(String.valueOf(cid).startsWith(System.Label.Oppor_sepKey)){
                OpporFileIds.add(cid);
            }
            // LHJ CHAN-BCLD4P 20190618 Start
            if(String.valueOf(link[0].LinkedEntityId).startsWith(System.Label.OppSpecialApply)){
                specDelIds.add(link[0].LinkedEntityId);
            if(String.valueOf(cid).startsWith(System.Label.OppSpecialApply)){
                specDelIds.add(cid);
            }
            // LHJ CHAN-BCLD4P 20190618 End
            if(String.valueOf(link[0].LinkedEntityId).startsWith('a3Z')){
                oFOrderIds.add(link[0].LinkedEntityId);
                oFOrderIdMap.put(link[0].LinkedEntityId,false);
            if(String.valueOf(cid).startsWith('a3Z')){
                oFOrderIds.add(cid);
                oFOrderIdMap.put(cid,false);
            }
            //2023-2-10  sx备品 备品检测分析报告 start
            Id cid = link[0].LinkedEntityId;
            String parentLabel = cid.getSObjectType().getDescribe().getName();
            System.debug('...' + cid.getSObjectType().getDescribe().getName());
            if(parentLabel.equals('Rental_Apply_Fault__c')){
                rentaldeleteApplyFaultIds.add(link[0].LinkedEntityId);
                conDeleteList.add(link[0]);
                rentaldeleteApplyFaultIds.add(cid);
                conDeleteList.add(link);
                if(deleteImages.containskey(version[0].Id)){
                    deleteImages.get(link[0].LinkedEntityId).add(version[0].Id);
                    deleteImages.get(cid).add(version[0].Id);
                }else{
                    List<Id> temp = new List<Id>();
                    temp.add(version[0].Id);
                    deleteImages.put(link[0].LinkedEntityId,temp);
                    deleteImages.put(cid,temp);
                }
            }
            //2023-2-10  sx备品 备品检测分析报告 end
        }
        //2023-2-10  sx备品 备品检测分析报告 start
        List<Rental_Apply_Fault__c> rafList = [SELECT Id, Name FROM Rental_Apply_Fault__c WHERE Id IN: rentaldeleteApplyFaultIds AND (status__c = '已发送' OR status__c = '已反馈')];
        List<Id> docList = new List<Id>();
        for (Rental_Apply_Fault__c raf : rafList) {
            for (ContentDocumentLink link1 : conDeleteList) {
                if (link1.LinkedEntityId == raf.Id) {
                    // ContentDocument doc = [select Id from ContentDocument where Id =: link.ContentDocumentId];
                    link1.addError('非草案中的检测分析报告不允许删除已上传的故障图片');
                    docList.add(link1.ContentDocumentId);
                }
            }
        }
        for(ContentDocument doc: Trigger.old){
            if(docList.contains(doc.Id)){
                doc.addError('非草案中的检测分析报告不允许删除已上传的故障图片');
            }
        }
        //2023-2-10  sx备品 备品检测分析报告 end
@@ -130,13 +195,19 @@
        system.debug('renList====='+renList);
        for(Rental_Apply_Fault__c ren : renList){
            if(deleteImages.containskey(ren.Id)){
                System.debug('att1' + ren.AttachmentId1__c);
                System.debug('att2' + ren.AttachmentId2__c);
                System.debug('ver' + deleteImages.get(ren.Id));
                if(deleteImages.get(ren.Id).contains(ren.AttachmentId1__c)){
                    ren.AttachmentId1__c = '';
                }
                if(deleteImages.get(ren.Id).contains(ren.AttachmentId2__c)){
                    ren.AttachmentId2__c = '';
                }
                // if(!(deleteImages.get(ren.Id).contains(ren.AttachmentId2__c)) && !(deleteImages.get(ren.Id).contains(ren.AttachmentId1__c))){
                //     ren.AttachmentId2__c = '';
                //     ren.AttachmentId1__c = '';
                // }
            }
        }
        system.debug('renList====='+renList);
@@ -189,30 +260,101 @@
            idList.add(doc.Id);
        }
        List<ContentDocumentLink> link = [select LinkedEntityId from ContentDocumentLink where ContentDocumentId in: idList];
        Id enId;
        for(ContentDocumentLink lin: link){
            if(lin.LinkedEntityId.getSObjectType().getDescribe().getName() != 'User'){
                enId = lin.LinkedEntityId;
            }
        }
        for(ContentDocument doc : Trigger.old){
            if(OpporFileUndeleteMap.containsKey(link[0].LinkedEntityId)){
            if(OpporFileUndeleteMap.containsKey(enId)){
                doc.addError('备货已审批,不可删除附件');
                return;
            }else{
                DeleteReIds.add(enId);
            }
        }
    }
    if(Trigger.isDelete && Trigger.isAfter){
        List<Id> idList = new List<Id>();
        for(ContentDocument doc : Trigger.old){
            idList.add(doc.Id);
    // if(Trigger.isDelete && Trigger.isAfter){
    //     List<Id> idList = new List<Id>();
    //     for(ContentDocument doc : Trigger.old){
    //         idList.add(doc.Id);
    //     }
    //     List<ContentDocumentLink> linkList = [select LinkedEntityId from ContentDocumentLink where ContentDocumentId in: idList];
    //     ContentDocumentLink link;
    //     for(ContentDocumentLink lin: linkList){
    //         if(lin.LinkedEntityId.getSObjectType().getDescribe().getName() != 'User'){
    //             link = lin;
    //         }
    //     }
    //     for(ContentDocument doc : Trigger.old){
    //         // List<ContentDocumentLink> link = [select LinkedEntityId from ContentDocumentLink where ContentDocumentId =: doc.Id];
    //         if(OpporFileUndeleteMap.containsKey(link.LinkedEntityId)){
    //             doc.addError('备货已审批,不可删除附件');
    //             return;
    //         }else{
    //             DeleteReIds.add(link.LinkedEntityId);
    //         }
    //     }
    // }
     //20221014 yc 医院审批优化 start
     if (accAppIds.size() > 0) {
        Map<String, String> attMap = new Map<String, String>();
        // List<Attachment> attList = [select Id, ParentId from Attachment where ParentId = :accAppIds order by ParentId];
        List<ContentDocumentLink> linkList = [select LinkedEntityId from ContentDocumentLink where LinkedEntityId =: accAppIds order by LinkedEntityId];
        for (ContentDocumentLink link : linkList) {
            attMap.put(link.LinkedEntityId, link.LinkedEntityId);
        }
        List<ContentDocumentLink> link = [select LinkedEntityId from ContentDocumentLink where ContentDocumentId in: idList];
        for(ContentDocument doc : Trigger.old){
            // List<ContentDocumentLink> link = [select LinkedEntityId from ContentDocumentLink where ContentDocumentId =: doc.Id];
            if(OpporFileUndeleteMap.containsKey(link[0].LinkedEntityId)){
                link[0].addError('备货已审批,不可删除附件');
                return;
            }else{
                DeleteReIds.add(link[0].LinkedEntityId);
        List<Account_Delay_Apply__c> updAccAppList = new List<Account_Delay_Apply__c>();
        //20221207 lt 医院审批优化 start
        List<Account_Delay_Apply__c> adaList = [select id,Name,
                                                         Is_Active__c
                                               from Account_Delay_Apply__c
                                               where id in:accAppIds ];
        //20221207 lt 医院审批优化 end
        for (String accappid : accAppIds) {
            if(adaList.size() > 0){
                // Account_Delay_Apply__c accapp = new Account_Delay_Apply__c(Id = accappid);
                //20221207 lt 医院审批优化 start
                for(Account_Delay_Apply__c accapp : adaList){
                    if(Trigger.isUpdate && Trigger.isBefore){
                        for(ContentDocument doc : Trigger.New){
                            if(accapp.Is_Active__c != '草案中'){
                                doc.addError('非草案中,附件不允许编辑。');
                                return;
                            }
                        }
                    }
                    if(Trigger.isDelete && Trigger.isBefore){
                        for(ContentDocument doc : Trigger.old){
                            // if(attMap.containsKey(att.ParentID) && accapp.Is_Active__c != '草案中'){
                            if(accapp.Is_Active__c != '草案中'){
                                doc.addError('非草案中,附件不允许删除。');
                                return;
                            }
                        }
                    }
                }
            }
            //20221207 lt 医院审批优化 end
        }
        try {
            if (updAccAppList.size() > 0) update updAccAppList;
        } catch (Exception e) {
            linkList[0].addError(e.getMessage());
        }
    }
    //20221014 yc 医院审批优化 end
    
    // List<Attachment> atcList = [select id,ParentId,createddate,createdbyid from Attachment where ParentId in:DeleteReIds];
@@ -222,21 +364,28 @@
        for (ContentDocumentLink link : linkList) {
            idList.add(link.ContentDocumentId);
        }
        List<ContentDocument> docList = [select Id,ArchivedDate,ArchivedById from ContentDocument where Id =: idList];
        List<ContentDocument> docList = [select Id,CreatedDate,CreatedById from ContentDocument where Id =: idList];
        System.debug(DeleteReIds+'222222222222');
        List<Id> oldList = new List<Id>();
        for(ContentDocument doc : Trigger.old){
            oldList.add(doc.Id);
        }
        if(docList.size()>0){
            for(String ids : DeleteReIds){
                for(ContentDocument doc : docList){
                    if(oldList.contains(doc.Id)){
                        continue;
                    }
                    if(OppordeleteReTimeMap.containsKey(ids)){
                        if(doc.ArchivedDate > OppordeleteReTimeMap.get(ids)){
                            OppordeleteReTimeMap.put(ids,doc.ArchivedDate);
                            OppordeleteReUserMap.put(ids,doc.ArchivedById);
                        if(doc.CreatedDate > OppordeleteReTimeMap.get(ids)){
                            OppordeleteReTimeMap.put(ids,doc.CreatedDate);
                            OppordeleteReUserMap.put(ids,doc.CreatedById);
                        }else{
                            continue;
                        }
                    }else{
                        OppordeleteReTimeMap.put(ids,doc.ArchivedDate);
                        OppordeleteReUserMap.put(ids,doc.ArchivedById);
                        OppordeleteReTimeMap.put(ids,doc.CreatedDate);
                        OppordeleteReUserMap.put(ids,doc.CreatedById);
                    }
                }
            }
@@ -296,5 +445,61 @@
        }                                            
    }
    if (accIds.size() > 0) {
        Map<String, String> attMap = new Map<String, String>();
        // List<Attachment> attList = [select Id, ParentId from Attachment where ParentId = :accIds order by ParentId];
        List<ContentDocumentLink> linkList = [select LinkedEntityId from ContentDocumentLink where LinkedEntityId =: accIds order by LinkedEntityId];
        for (ContentDocumentLink link : linkList) {
            attMap.put(link.LinkedEntityId, link.LinkedEntityId);
        }
        List<Account> updAccList = new List<Account>();
        //20221207 lt 医院审批优化 start
        List<Account> accList = [select id,Name,
                                                         Is_Active__c
                                               from Account
                                               where id in:accIds ];
        //20221207 lt 医院审批优化 end
        for (String accid : accIds) {
            if(accList.size() > 0){
                // Account acc = new Account(Id = accid);
                //20221207 lt 医院审批优化 start
                for(Account acc : accList){
                    if(Trigger.isUpdate && Trigger.isBefore){
                        for(ContentDocument link: Trigger.Old){
                            System.debug(link + 'old');
                        }
                        for(ContentDocument link : Trigger.New){
                            System.debug(link + 'new');
                            if(attMap.containsKey(acc.Id) &&acc.Is_Active__c != '草案中'){
                                System.debug('lt123---草案中---');
                                link.addError('非草案中,附件不允许编辑。');
                                return;
                            }
                        }
                    }
                    if(Trigger.isDelete && (Trigger.isBefore)){
                        for(ContentDocument link : Trigger.old){
                            if(acc.Is_Active__c != '草案中'){
                                link.addError('非草案中,附件不允许删除。');
                                return;
                            }
                        }
                    }
                    acc.Is_upload_file__c = attMap.containsKey(accid);
                    updAccList.add(acc);
                }
            }
            //20221207 lt 医院审批优化 end
        }
        // for (String accid : accIds) {
    //     //     Account acc = new Account(Id = accid);
    //     //     acc.Is_upload_file__c = attMap.containsKey(accid);
    //     //     updAccList.add(acc);
    //     // }
    //     if (updAccList.size() > 0) update updAccList;
}
}
force-app/main/default/triggers/ContentVersionTrigger.trigger
@@ -1,3 +1,7 @@
trigger ContentVersionTrigger on ContentVersion (before update,after update) {
trigger ContentVersionTrigger on ContentVersion (after insert) {
    // if(Trigger.isInsert){
    //     for(ContentVersion version: Trigger.old){
    //         version.addError('test');
    //     }
    // }
}
force-app/main/default/triggers/RentalApplyFaultTrigger.trigger
New file
@@ -0,0 +1,4 @@
trigger RentalApplyFaultTrigger on Rental_Apply_Fault__c (before insert, before update,after insert,after update,after delete) {
    RentalApplyFaultHandler handler = new RentalApplyFaultHandler();
    handler.run();
}
force-app/main/default/triggers/RentalApplyFaultTrigger.trigger-meta.xml
New file
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexTrigger xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>57.0</apiVersion>
    <status>Active</status>
</ApexTrigger>