From bdb1a98b64a2cf59bcfd575c579aa0742e0de954 Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期五, 24 五月 2024 17:21:32 +0800
Subject: [PATCH] 1

---
 force-app/main/default/lwc/lexNewQuoteEntry/lexNexQuoteEntryUtil.js |   25 +++++++++++--------------
 1 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/force-app/main/default/lwc/lexNewQuoteEntry/lexNexQuoteEntryUtil.js b/force-app/main/default/lwc/lexNewQuoteEntry/lexNexQuoteEntryUtil.js
index 0c34856..b5cfbee 100644
--- a/force-app/main/default/lwc/lexNewQuoteEntry/lexNexQuoteEntryUtil.js
+++ b/force-app/main/default/lwc/lexNewQuoteEntry/lexNexQuoteEntryUtil.js
@@ -738,23 +738,13 @@
     } 
 } 
 function SetProductId(lineno,selectv){
-   //fy DB202312538864 2024.02.02 start
-    // var Product2 = {};
-    // var PricebookEntry = {Product2:Product2};
-    // var pageObject = {};
-    // var addobj = {PricebookEntry:PricebookEntry,
-    //                 latestInfo:latestInfo,
-    //                 pageObject:pageObject};
-    // var attributes1 = {type: "PricebookEntry"};
-    // var attributes2 = {type: "Product2"};
-    // var attributes3 = {type: "QuoteLineItem"};
     var Product2 = {};
     var PricebookEntry = {Product2:Product2};
     var latestInfo = {};
-    var pageObject = {PricebookEntry:PricebookEntry,PricebookEntryId:''};
-    var addobj = {latestInfo:latestInfo,
+    var pageObject = {};
+    var addobj = {PricebookEntry:PricebookEntry,
+                    latestInfo:latestInfo,
                     pageObject:pageObject};
-    //fy DB202312538864 2024.02.02 end
     var Asset_Model_No__c = selectv.Product2.Asset_Model_No__c;
     var Product2Id = selectv.Product2Id;
     var SFDA_Status__c = selectv.Product2.SFDA_Status__c
@@ -1066,8 +1056,15 @@
     console.warn(JSON.stringify(quoteLineItem));
     quoteLineItem.forEach(quotltiem=>{
         // chenjingwu 20240411 start
+        if(quotltiem.PricebookEntry === undefined){
+            quotltiem.PricebookEntry = {Product2:{}};
+          }else{
+              if(quotltiem.PricebookEntry.Product2 === undefined){
+                  quotltiem.PricebookEntry.Product2 = {};
+              }
+          }
         if(quotltiem.ProductCategory !== undefined && quotltiem.ProductCategory !== null){
-            quotltiem.pageObject.PricebookEntry.Product2.ProductCategory__c = quotltiem.ProductCategory;
+            quotltiem.PricebookEntry.Product2.ProductCategory__c = quotltiem.ProductCategory;
         }
         // chenjingwu 20240411 end        
         quotltiem.Quantity__c = quotltiem.pageObject.Quantity__c;

--
Gitblit v1.9.1