19626
2023-10-11 7c7cb195462c2ded7bfe4105959ea36d1dd68ded
force-app/main/default/classes/lexPCLLostReportLwcController.cls
@@ -92,6 +92,7 @@
      pickList.put('洗消机', xixiaoji);
      pickList.put('光源', guangyuan);
      pickList.put('其他', qita);
      pickList.put('全部',lstPickvals);
        return JSON.serialize(pickList);
    }
   @AuraEnabled
@@ -104,7 +105,7 @@
         submitFlag = submitFlag1;
         return init1();
      } catch (Exception e) {
         throw new AuraHandledException(e.getMessage());
         return e.getMessage();
      }
   }
   // 初始化
@@ -310,14 +311,14 @@
         if(pros.size() > 0){
            
            List<ProcessInstanceHistory> items = new List<ProcessInstanceHistory>();
            maps.put('allowUserId',pros[0].StepsAndWorkitems[0].OriginalActor.Id);
            maps.put('allowUserId',pros[0].StepsAndWorkitems[0].Actor.Id);
            maps.put('userProfileId',UserInfo.getProfileId());
            for(ProcessInstance pro: pros){
               items.addAll(pro.StepsAndWorkitems);
            }
            for(ProcessInstanceHistory pro: pros[0].StepsAndWorkitems){
               if(pro.StepStatus == 'Started'){
                  maps.put('submitUserId',pro.OriginalActorId);
                  maps.put('submitUserId',pro.ActorId);
               }
            }
            LostReport.approvalHistorys = items;
@@ -381,7 +382,7 @@
         }
         
      } catch (Exception e) {
         throw new AuraHandledException(e.getMessage());
         return e.getMessage();
      }
   }
   // 数据录入
@@ -764,30 +765,7 @@
         }
      }
   }
   // add tcm 20211119 end
   // add tcm 20211118 start
   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].bool=false;
      }else {
         Product2 prd = [select Id,ProductClass__c
         , ProductCategory__c
         from Product2 where Id =:LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.LostProduct__c];
         if (prd.ProductCategory__c!=null) {
            LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductClass__c=prd.ProductClass__c;
            LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductCategory__c=prd.ProductCategory__c;
            LostReport.LostBrands[topNum].LostProducts[secondNum].bool=true;
         }else {
            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;
         }
      }
   }
   @AuraEnabled
   public static string searchProduct(String lostProduct){
      Product2 prd = null;
@@ -797,7 +775,7 @@
         , ProductCategory__c 
         from Product2 where Id =:lostProduct];
      } catch (Exception e) {
         throw new AuraHandledException(e.getMessage());
         return e.getMessage();
      }
      return JSON.serialize(prd);
   }