From f05bfc9a39bccc8afb928efe7555f21e0e69c5bd Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期一, 10 七月 2023 10:51:38 +0800
Subject: [PATCH] backupfixtablecolumn0710

---
 force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js |  106 +++++++++++++++++++++++++----------------------------
 1 files changed, 50 insertions(+), 56 deletions(-)

diff --git a/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js b/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js
index 3b4fb28..4854e6c 100644
--- a/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js
+++ b/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js
@@ -48,6 +48,7 @@
   @track showTable = false;
   @track hidecheckboxcolumn = true;
   @track check = false;
+  @track productkucun;
   //鍔犺浇
   @track showSpinner = false;
   @track showSpinners = false;
@@ -63,14 +64,14 @@
       type: "Name",
       sortable: true,
       hideDefaultActions: true,
-      initialWidth: 300,
+      // initialWidth: 200,
       wrapText: true,
       cellAttributes: { alignment: "left" }
     },
     {
       label: "绗笁鍒嗙被",
       fieldName: "Category3__c",
-      initialWidth: 90,
+      initialWidth: 84,
       cellAttributes: { alignment: "left" },
       hideDefaultActions: true,
       sortable: true,
@@ -80,7 +81,7 @@
       label: "绗洓鍒嗙被",
       fieldName: "Category4__c",
       cellAttributes: { alignment: "left" },
-      initialWidth: 90,
+      initialWidth: 84,
       hideDefaultActions: true,
       wrapText: true,
       sortable: true
@@ -89,7 +90,7 @@
       label: "绗簲鍒嗙被",
       fieldName: "Category5__c",
       cellAttributes: { alignment: "left" },
-      initialWidth: 90,
+      initialWidth: 84,
       hideDefaultActions: true,
       wrapText: true,
       sortable: true
@@ -99,7 +100,7 @@
       label: "瑙勬牸",
       fieldName: "packing_list",
       cellAttributes: { alignment: "right" },
-      initialWidth: 55,
+      initialWidth: 50,
       wrapText: true,
       hideDefaultActions: true
     },
@@ -107,7 +108,7 @@
       label: "鍗曚綅",
       fieldName: "BoxPiece",
       cellAttributes: { alignment: "left" },
-      initialWidth: 55,
+      initialWidth: 50,
       wrapText: true,
       hideDefaultActions: true
     },
@@ -116,7 +117,7 @@
       fieldName: "approbation_No",
       cellAttributes: { alignment: "left" },
       wrapText: true,
-      initialWidth: 155,
+      initialWidth: 104,
       hideDefaultActions: true
     },
     {
@@ -125,13 +126,13 @@
       cellAttributes: { alignment: "left" },
       wrapText: true,
       hideDefaultActions: true,
-      initialWidth: 100
+      initialWidth: 95
     },
     {
       label: "CFDA鐘舵��",
       fieldName: "SFDA_Status__c",
       cellAttributes: { alignment: "left" },
-      initialWidth: 95,
+      initialWidth: 84,
       wrapText: true,
       hideDefaultActions: true
     },
@@ -145,7 +146,8 @@
     {
       label: "鏈夋晥鏈熷唴搴撳瓨",
       type: "customInventoryColor",
-      // sortable: true,
+      fieldName: "limitCount",
+      sortable: true,
       cellAttributes: { alignment: "right" },
       typeAttributes: {
         value: { fieldName: "limitCount" },
@@ -154,7 +156,7 @@
         boxPrice: { fieldName: "BoxPiece" }
       },
       hideDefaultActions: true,
-      initialWidth: 150
+      initialWidth: 120
     },
 
     {
@@ -208,18 +210,6 @@
         console.log("result = " + JSON.stringify(result));
         console.log("result 1= " + JSON.stringify(result.entity));
         console.log("result 2= " + JSON.stringify(result.entity.pageRecords));
-        console.log(
-          "result.entity.categoryOptionMap 2= " +
-            JSON.stringify(result.entity.categoryOptionMap)
-        );
-        console.log(
-          "result.entity.categoryOptionMap 2= " +
-            JSON.stringify(result.entity.category4OptionMap)
-        );
-        console.log(
-          "result.entity.categoryOptionMap 2= " +
-            JSON.stringify(result.entity.category5OptionMap)
-        );
         if (result.status == "Success") {
           console.log(
             "result.entity.paginatedAccounts = " +
@@ -237,12 +227,13 @@
 
           this.loader = false;
           this.data = result.entity.pageRecords;
+          this.productkucun = result.entity.productkucun;
 
           for (var i in this.data) {
             this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
             this.data[i]["Category3__c"] = this.data[i].Prod.Category3__c;
-            this.data[i]["Category4__c"] = this.data[i].Prod.Category3__c;
-            this.data[i]["Category5__c"] = this.data[i].Prod.Category3__c;
+            this.data[i]["Category4__c"] = this.data[i].Prod.Category4__c;
+            this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c;
             this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c;
           }
           this.showTable = true;
@@ -296,8 +287,8 @@
             for (var j in this.data) {
               this.data[j]["Name__c"] = this.data[j].Prod.Name__c;
               this.data[j]["Category3__c"] = this.data[j].Prod.Category3__c;
-              this.data[j]["Category4__c"] = this.data[j].Prod.Category3__c;
-              this.data[j]["Category5__c"] = this.data[j].Prod.Category3__c;
+              this.data[j]["Category4__c"] = this.data[j].Prod.Category4__c;
+              this.data[j]["Category5__c"] = this.data[j].Prod.Category5__c;
               this.data[j]["SFDA_Status__c"] = this.data[j].Prod.SFDA_Status__c;
               this.data[j]["hospitalSpecialOffer__c"] =
                 this.data[j].hospitalSpecialOffer;
@@ -360,7 +351,7 @@
         }
         break;
       case "CategoryFour":
-        this.Category4 = value;
+        this.CategoryFour = value;
         //璋冪敤鍚庡彴鏄剧ず绗簲鍒嗙被
         this.showCate();
         if (this.CategoryFour == "") {
@@ -413,6 +404,7 @@
 
   searchOrderDetail() {
     this.showTable = false;
+    this.showSpinner = true;
     searchOrder({
       category1: this.Name,
       Category3: this.CategoryThree,
@@ -423,7 +415,9 @@
       agencyProType: this.agencyProType,
       userWorkLocation: this.userWorkLocation,
       pageSizeLWC: this.pageSize,
-      pageTokenLWC: this.currentPageToken
+      pageTokenLWC: this.currentPageToken,
+      productkucunLWC: this.productkucun
+
       // sortFieldLWC: this.sortBy,
       // sortOrderLWC: this.sortDirection
     })
@@ -437,32 +431,46 @@
           this.totalPages = Math.ceil(
             result.entity.paginatedAccounts.totalRecords / this.pageSize
           );
+          console.log(
+            "result.entity.paginatedAccounts = " +
+              JSON.stringify(result.entity.paginatedAccounts)
+          );
           console.log("this.totalPages = " + this.totalPages);
           this.paginationVisibility = this.totalPages > 1 ? true : false;
           console.log("this.sortDirection = " + this.sortDirection);
           // this.showToast("Success",'鎼滅储鎴愬姛', result.msg);
-          this.showMyToast("鎼滅储鎴愬姛", result.msg, "success");
+          // this.showMyToast('鎼滅储鎴愬姛',result.msg,'success');
           this.data = result.entity.pageRecords;
           console.log("鎼滅储Data==>" + JSON.stringify(this.data));
           for (var i in this.data) {
             this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
             this.data[i]["Category3__c"] = this.data[i].Prod.Category3__c;
-            this.data[i]["Category4__c"] = this.data[i].Prod.Category3__c;
-            this.data[i]["Category5__c"] = this.data[i].Prod.Category3__c;
+            this.data[i]["Category4__c"] = this.data[i].Prod.Category4__c;
+            this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c;
             this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c;
             this.data[i]["hospitalSpecialOffer__c"] =
               this.data[i].hospitalSpecialOffer;
+            this.data[i]["guaranteeperiod"] = this.data[i].guaranteeperiod;
           }
           this.data = [...this.data];
           console.log("this.data = " + JSON.stringify(this.data));
           this.showTable = true;
+          this.showSpinner = false;
         } else {
+          this.nextPageToken = this.pageSize;
+          this.totalRecords = 0;
+          this.recordStart = 0;
+          this.recordEnd = 0;
+          this.totalPages = 0;
+
           // this.showToast("Error",'Error', result.msg);
-          this.showMyToast("鎼滅储澶辫触", result.msg, "error");
+          // this.showMyToast('鎼滅储澶辫触',result.msg,'error');
+          this.showSpinner = false;
         }
       })
       .catch((error) => {
         console.log("error = " + JSON.stringify(error));
+        this.showSpinner = false;
       });
   }
   inventoryCount() {
@@ -522,7 +530,8 @@
       agencyProType: this.agencyProType,
       userWorkLocation: this.userWorkLocation,
       pageSizeLWC: this.pageSize,
-      pageTokenLWC: this.currentPageToken
+      pageTokenLWC: this.currentPageToken,
+      productkucunLWC: this.productkucun
     })
       .then((result) => {
         console.log("result鎼滅储 = " + JSON.stringify(result));
@@ -543,22 +552,24 @@
           for (var i in this.data) {
             this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
             this.data[i]["Category3__c"] = this.data[i].Prod.Category3__c;
-            this.data[i]["Category4__c"] = this.data[i].Prod.Category3__c;
-            this.data[i]["Category5__c"] = this.data[i].Prod.Category3__c;
+            this.data[i]["Category4__c"] = this.data[i].Prod.Category4__c;
+            this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c;
             this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c;
+            this.data[i]["guaranteeperiod"] = this.data[i].guaranteeperiod;
           }
           this.showSpinner = false;
           this.showTable = true;
-          this.showMyToast("鎼滅储鎴愬姛", result.msg, "success");
+          // this.showMyToast('鎼滅储鎴愬姛',result.msg,'success');
           // this.showToast("Success",'鎼滅储鎴愬姛', result.msg);
-          this.showSpinner = false;
         } else {
           // this.showToast("Error", 'Error',result.msg);
-          this.showMyToast("鎼滅储澶辫触", result.msg, "error");
+          // this.showMyToast('鎼滅储澶辫触',result.msg,'error');
+          this.showSpinner = false;
         }
       })
       .catch((error) => {
         console.log("error = " + JSON.stringify(error));
+        this.showSpinner = false;
       });
   }
 
@@ -667,22 +678,5 @@
     this.template
       .querySelector("c-common-toast")
       .showToast(variant, content, iconName, 10000);
-
-    // showToast(type,title,msg) {
-    // 	this.showSpinner = false;
-    // 	let mode = '';
-    // 	if (type.toLowerCase() != 'success') {
-    // 		mode = 'sticky';
-    // 	} else {
-    // 		mode = 'dismissable';
-    // 	}
-    // 	const event = new ShowToastEvent({
-    // 		title: title,
-    // 		variant: type,
-    // 		message: msg,
-    // 		mode: mode
-    // 	});
-    // 	this.dispatchEvent(event);
-    // }
   }
 }

--
Gitblit v1.9.1