From cb95755fe8496d8af6d40b05c4bbd4b6df2e77ab Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期一, 05 六月 2023 14:39:34 +0800
Subject: [PATCH] LEX Community Report&Dashboard

---
 force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js |   49 ++++++++++++++++++++++++++++++++++---------------
 1 files changed, 34 insertions(+), 15 deletions(-)

diff --git a/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js b/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
index 4361ac7..74a0853 100644
--- a/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
+++ b/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
@@ -25,7 +25,13 @@
 import { loadStyle } from "lightning/platformResourceLoader";
 import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
 
+import ConsumableOutboundReportId from '@salesforce/label/c.ConsumableOutboundReportId';
+const customLabel = {
+    ConsumableOutboundReportId
+}
+
 export default class LexSummonsCreat extends NavigationMixin(LightningElement) {
+    @track label = customLabel;
     @track isShowSpinner = true;
     @track isEditShowSpinner = false;
     @track showResults = true;
@@ -87,6 +93,7 @@
         {
             label: "娉ㄥ唽璇佹晥鏈�",
             wrapText: true,
+            initialWidth: 115,
             fieldName: "expiration_Date",
             hideDefaultActions: true,
         },
@@ -94,6 +101,7 @@
             label: "绗�3鍒嗙被",
             fieldName: "Category3__c",
             wrapText: true,
+            initialWidth: 115,
             hideDefaultActions: true,
             sortable: true,
         },
@@ -101,6 +109,7 @@
             label: "绗�4鍒嗙被",
             fieldName: "Category4__c",
             wrapText: true,
+            initialWidth: 115,
             hideDefaultActions: true,
             sortable: true,
         },
@@ -108,26 +117,29 @@
             label: "绗�5鍒嗙被",
             fieldName: "Category5__c",
             wrapText: true,
+            initialWidth: 115,
             hideDefaultActions: true,
             sortable: true,
         },
         {
             label: "鍗曚綅",
             type: "customUnit",
+            initialWidth: 100,
             hideDefaultActions: true,
             typeAttributes: {
                 unitValue: { fieldName: "unitValue" },
                 unitOptions: { fieldName: "unitOptions" },
-                recordId: { fieldName: "recordId" },
+                recordId: { fieldName: "Id" },
             },
         },
         {
             label: "鍑鸿揣鏁伴噺",
             type: "customShipment",
+            initialWidth: 100,
             hideDefaultActions: true,
             cellAttributes: { alignment: "right" },
             typeAttributes: {
-                recordId: { fieldName: "recordId" },
+                recordId: { fieldName: "Id" },
                 shipmentNumber: { fieldName: "shipmentNumber" },
             },
         },
@@ -135,16 +147,16 @@
             label: "鍑鸿揣鍗曚环(鍏�)",
             type: "customShipmentUnitPrice",
             hideDefaultActions: true,
-            initialWidth: 110,
+            initialWidth: 120,
             typeAttributes: {
-                recordId: { fieldName: "recordId" },
+                recordId: { fieldName: "Id" },
                 shippingUnitPrice: { fieldName: "shippingUnitPrice" },
             },
         },
         {
             label: "鍑鸿揣閲戦(鍏�)",
             type: "customShipmentAmount",
-            initialWidth: 110,
+            initialWidth: 120,
             cellAttributes: { alignment: "right" },
             hideDefaultActions: true,
             typeAttributes: {
@@ -156,7 +168,7 @@
             fieldName: "Boxnumber",
             cellAttributes: { alignment: "right" },
             wrapText: true,
-            initialWidth: 120,
+            initialWidth: 160,
             hideDefaultActions: true,
         },
         {
@@ -164,7 +176,7 @@
             fieldName: "Piecenumber",
             cellAttributes: { alignment: "right" },
             wrapText: true,
-            initialWidth: 120,
+            initialWidth: 160,
             hideDefaultActions: true,
         },
     ];
@@ -173,7 +185,7 @@
             label: "娑堣�楀搧鍚嶇О",
             fieldName: "Name__c",
             hideDefaultActions: true,
-            initialWidth: 340,
+            initialWidth: 320,
             wrapText: true,
             sortable: true,
         },
@@ -262,6 +274,7 @@
             fieldName: "Name",
             initialWidth: 400,
             hideDefaultActions: true,
+            wrapText: true,
         },
         {
             label: "鐪佷唤",
@@ -718,6 +731,8 @@
                 this.data = r.entity.pageRecords;
                 this.editData = r.entity.pageRecords;
                 console.log("this.data start = " + JSON.stringify(this.data));
+                this.hasHosPro = r.entity.hasHosPro;
+                console.log("this.hasHosPro = " + this.hasHosPro);
                 if (this.EditAble) {
                     for (var i in this.data) {
                         let unitOptions = [];
@@ -750,6 +765,7 @@
 
 
                         this.data[i]["Id"] = this.data[i].Prod.Id;
+
                         if (this.hasHosPro) {
                             if (this.data[i]["hospitalSpecialOffer"]) {
                                 this.data[i]["Id"] = this.data[i].Prod.Id + 'ishos';
@@ -772,6 +788,7 @@
                             this.selectedRows.push(this.data[i].Id);
                         }
                     }
+                    console.log('EditAble this.data = ' + JSON.stringify(this.data))
                 } else {
                     for (var i in this.editData) {
                         this.editData[i]["unitValue"] = this.editData[i]["unitValue"];
@@ -813,7 +830,7 @@
                 this.Existarrive = r.entity.Existarrive;
 
                 console.log("this.EditAble = " + this.EditAble);
-                this.hasHosPro = r.entity.hasHosPro;
+                
                 //disable
 
                 if (Object.values(r.entity.coc).length > 0) {
@@ -930,7 +947,7 @@
                         label: this.InvoiceProNotLabel,
                         fieldName: "InvoiceProNot_count__c",
                         type: "number",
-                        initialWidth: 100,
+                        initialWidth: 120,
                         typeAttributes: {
                             minimumFractionDigits: 2,
                         },
@@ -1011,7 +1028,7 @@
                         label: "鍖婚櫌鐗逛环",
                         fieldName: "hospitalSpecialOffer",
                         type: 'boolean',
-                        initialWidth: 70,
+                        initialWidth: 100,
                         hideDefaultActions: true,
                     };
                     this.columns.push(object1);
@@ -1483,7 +1500,7 @@
         const unitDetail = event.detail;
         console.log("unitDetail = " + JSON.stringify(unitDetail));
         for (var i in this.data) {
-            if (this.data[i].recordId == unitDetail.data.recordId) {
+            if (this.data[i].Id == unitDetail.data.recordId) {
                 this.data[i].unitValue = unitDetail.data.unitValue;
                 this.data[i].orderdetails1["Box_Piece__c"] = unitDetail.data.unitValue;
             }
@@ -1497,7 +1514,7 @@
         console.log("numberDetail = " + JSON.stringify(numberDetail));
         let index = 0;
         for (var i in this.data) {
-            if (this.data[i].recordId == numberDetail.data.recordId) {
+            if (this.data[i].Id == numberDetail.data.recordId) {
                 index = i;
                 this.data[i].shipmentNumber = Number(numberDetail.data.shipmentnumber);
                 this.data[i].orderdetails1["Shipment_Count__c"] = Number(
@@ -1532,7 +1549,7 @@
         const priceDetail = event.detail;
         let index = 0;
         for (var i in this.data) {
-            if (this.data[i].recordId == priceDetail.data.recordId) {
+            if (this.data[i].Id == priceDetail.data.recordId) {
                 index = i;
                 this.data[i].shippingUnitPrice = Number(
                     priceDetail.data.shipmentunitprice
@@ -1763,7 +1780,9 @@
         var reportId = this.ESetid;
         reportId = reportId.substring(0, 15);
         let reportFilters = '[{"operator":"equals","value":"' + reportId + '","column":"FK_CUSTENT_ID"}]';
-        let url = "/report/00O0l000000zZtpEAE?reportFilters=" + encodeURIComponent(reportFilters);
+        let reportUrl = this.label.ConsumableOutboundReportId;
+        console.log("reportUrl = " + reportUrl);
+        let url = "/report/" + reportUrl + "?reportFilters=" + encodeURIComponent(reportFilters);
         console.log("url = " + url);
         this[NavigationMixin.Navigate]({
             type: "standard__webPage",

--
Gitblit v1.9.1