From 00e147ec892cb1e89d0698787a8c60da1014cdb7 Mon Sep 17 00:00:00 2001
From: binxie <137736985@qq.com>
Date: 星期一, 26 六月 2023 17:42:22 +0800
Subject: [PATCH] Community升级

---
 force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js |  874 +++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 568 insertions(+), 306 deletions(-)

diff --git a/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js b/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
index d638229..76f7619 100644
--- a/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
+++ b/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
@@ -1,4 +1,4 @@
-import { LightningElement, wire, api, track } from "lwc";
+import { LightningElement, wire, api, track } from "lwc"; save
 import init from "@salesforce/apex/LexSummonsCreatController.init";
 import { ShowToastEvent } from "lightning/platformShowToastEvent";
 import searchConsumableorderdetails from "@salesforce/apex/LexSummonsCreatController.searchConsumableorderdetails";
@@ -19,9 +19,19 @@
 import { getObjectInfo } from "lightning/uiObjectInfoApi";
 import hospitalInit from "@salesforce/apex/lexSearchAgencyHospitalController.init";
 import serContact from "@salesforce/apex/lexSearchAgencyHospitalController.serContact";
+import deleteAtt from '@salesforce/apex/LexSummonsCreatController.deleteAtt';
 import { NavigationMixin } from "lightning/navigation";
+//table css 
+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;
@@ -55,96 +65,99 @@
             fieldName: "Name__c",
             hideDefaultActions: true,
             wrapText: true,
-            initialWidth: 150,
+            initialWidth: 175,
             sortable: true
         },
         {
             label: "瑙勬牸",
             fieldName: "packinglist",
-            //initialWidth : 50,
+            cellAttributes: { alignment: "right" },
             wrapText: true,
+            initialWidth: 50,
             hideDefaultActions: true,
         },
         {
             label: "CFDA鐘舵��",
             fieldName: "SFDA_Status__c",
-            //initialWidth : 100,
+            initialWidth: 105,
             wrapText: true,
             hideDefaultActions: true,
         },
         {
             label: "娉ㄥ唽璇佺紪鐮佸彿",
             fieldName: "approbation_No",
-            //initialWidth : 150,
             wrapText: true,
+            initialWidth: 130,
             hideDefaultActions: true,
         },
         {
             label: "娉ㄥ唽璇佹晥鏈�",
-            //initialWidth : 100,
             wrapText: true,
+            initialWidth: 115,
             fieldName: "expiration_Date",
             hideDefaultActions: true,
         },
         {
             label: "绗�3鍒嗙被",
             fieldName: "Category3__c",
-            //initialWidth : 100,
             wrapText: true,
+            initialWidth: 115,
             hideDefaultActions: true,
             sortable: true,
         },
         {
             label: "绗�4鍒嗙被",
             fieldName: "Category4__c",
-            //initialWidth : 100,
             wrapText: true,
+            initialWidth: 115,
             hideDefaultActions: true,
             sortable: true,
         },
         {
             label: "绗�5鍒嗙被",
             fieldName: "Category5__c",
-            //initialWidth : 100,
             wrapText: true,
+            initialWidth: 115,
             hideDefaultActions: true,
             sortable: true,
         },
         {
             label: "鍗曚綅",
             type: "customUnit",
-            //initialWidth : 100,
+            initialWidth: 100,
             hideDefaultActions: true,
             typeAttributes: {
                 unitValue: { fieldName: "unitValue" },
                 unitOptions: { fieldName: "unitOptions" },
-                recordId: { fieldName: "recordId" },
-            },
+                recordId: { fieldName: "Id" },
+            }
         },
         {
             label: "鍑鸿揣鏁伴噺",
             type: "customShipment",
-            //initialWidth : 150,
+            initialWidth: 100,
             hideDefaultActions: true,
+            cellAttributes: { alignment: "right" },
             typeAttributes: {
-                recordId: { fieldName: "recordId" },
+                recordId: { fieldName: "Id" },
                 shipmentNumber: { fieldName: "shipmentNumber" },
             },
         },
         {
             label: "鍑鸿揣鍗曚环(鍏�)",
             type: "customShipmentUnitPrice",
-            //initialWidth : 150,
             hideDefaultActions: true,
+            initialWidth: 120,
             typeAttributes: {
-                recordId: { fieldName: "recordId" },
+                recordId: { fieldName: "Id" },
                 shippingUnitPrice: { fieldName: "shippingUnitPrice" },
             },
         },
         {
             label: "鍑鸿揣閲戦(鍏�)",
             type: "customShipmentAmount",
-            //initialWidth : 120,
+            initialWidth: 120,
+            cellAttributes: { alignment: "right" },
             hideDefaultActions: true,
             typeAttributes: {
                 shipmentAmount: { fieldName: "shipmentAmount" },
@@ -153,15 +166,17 @@
         {
             label: "鏈夋晥鏈熷唴搴撳瓨(鐩�)",
             fieldName: "Boxnumber",
-            //initialWidth : 120,
+            cellAttributes: { alignment: "right" },
             wrapText: true,
+            initialWidth: 160,
             hideDefaultActions: true,
         },
         {
             label: "鏈夋晥鏈熷唴搴撳瓨(涓�)",
             fieldName: "Piecenumber",
-            //initialWidth : 120,
+            cellAttributes: { alignment: "right" },
             wrapText: true,
+            initialWidth: 160,
             hideDefaultActions: true,
         },
     ];
@@ -170,33 +185,36 @@
             label: "娑堣�楀搧鍚嶇О",
             fieldName: "Name__c",
             hideDefaultActions: true,
-            initialWidth: 250,
+            initialWidth: 320,
             wrapText: true,
             sortable: true,
         },
         {
             label: "瑙勬牸",
             fieldName: "packinglist",
-            initialWidth: 50,
+            initialWidth: 80,
+            cellAttributes: { alignment: "right" },
             hideDefaultActions: true,
+            wrapText: true,
         },
         {
             label: "CFDA鐘舵��",
             fieldName: "SFDA_Status__c",
-            initialWidth: 100,
             hideDefaultActions: true,
+            wrapText: true,
         },
         {
             label: "娉ㄥ唽璇佺紪鐮佸彿",
             fieldName: "approbation_No",
-            initialWidth: 150,
             hideDefaultActions: true,
+            initialWidth: 130,
+            wrapText: true,
         },
         {
             label: "娉ㄥ唽璇佹晥鏈�",
-            initialWidth: 100,
             fieldName: "expiration_Date",
             hideDefaultActions: true,
+            wrapText: true,
         },
         {
             label: "绗�3鍒嗙被",
@@ -204,6 +222,7 @@
             initialWidth: 100,
             hideDefaultActions: true,
             sortable: true,
+            wrapText: true,
         },
         {
             label: "绗�4鍒嗙被",
@@ -211,6 +230,7 @@
             initialWidth: 100,
             hideDefaultActions: true,
             sortable: true,
+            wrapText: true,
         },
         {
             label: "绗�5鍒嗙被",
@@ -218,28 +238,32 @@
             initialWidth: 100,
             hideDefaultActions: true,
             sortable: true,
+            wrapText: true,
         },
         {
             label: "鍗曚綅",
             fieldName: "Box_Piece__c",
-            initialWidth: 100,
+            initialWidth: 50,
             hideDefaultActions: true,
+            wrapText: true,
         },
         {
             label: "鍑鸿揣鏁伴噺",
             fieldName: "Shipment_Count__c",
-            initialWidth: 150,
+            cellAttributes: { alignment: "right" },
             hideDefaultActions: true,
+            initialWidth: 100,
+            wrapText: true,
         },
         {
             label: "鍑鸿揣鍗曚环(鍏�)",
-            fieldName: "Shipment_amount__c",
+            fieldName: "shippingUnitPrice",
             type: "number",
             typeAttributes: {
                 minimumFractionDigits: 2,
             },
-            initialWidth: 150,
             hideDefaultActions: true,
+            wrapText: true,
         },
     ];
     @track editData = [];
@@ -247,27 +271,28 @@
     @track hospitalList = [];
     @track hospitalColumns = [
         {
-            label: "鍖婚櫌鍚嶇О",
-            fieldName: "Name",
-            initialWidth: 400,
-            hideDefaultActions: true,
-        },
-        {
-            label: "鐪佷唤",
-            fieldName: "stateMasterName",
-            hideDefaultActions: true,
-        },
-        {
-            label: "閫夋嫨",
+            label: "",
             fieldName: "Id1",
             type: "button",
             hideDefaultActions: true,
+            initialWidth: 90,
             typeAttributes: {
                 label: "閫夋嫨",
                 name: "Id2",
                 size: 1,
             },
         },
+        {
+            label: "鍖婚櫌鍚嶇О",
+            fieldName: "Name",
+            hideDefaultActions: true,
+            wrapText: true,
+        },
+        {
+            label: "鐪佷唤",
+            fieldName: "stateMasterName",
+            hideDefaultActions: true,
+        }
     ];
 
     @track accountid = "";
@@ -281,12 +306,14 @@
     @track isMutualTransferGoods = false;
     @track Barcode = "";
     @track summonsForDirction = '';
+    @track accountValue = '';
 
     @track consumableorderdetails2RecordsColumns = [
         {
             label: "娑堣�楀搧鍚嶇О",
             fieldName: "ProdName",
             hideDefaultActions: true,
+            wrapText: true,
         },
         {
             label: "鎵规鍙�",
@@ -310,8 +337,14 @@
     @track salesColumns = [
         {
             label: "娑堣�楀搧璁㈠崟",
-            fieldName: "Consumable_order_minor__c",
+            fieldName: "ConsumableorderminorUrl",
             hideDefaultActions: true,
+            initialWidth: 210,
+            type: "url",
+            typeAttributes: {
+                label: { fieldName: "Consumable_order_minor__c" },
+                target: "_blank",
+            },
             wrapText: true,
         },
         {
@@ -331,6 +364,7 @@
             fieldName: "Box_Piece__c",
             hideDefaultActions: true,
             wrapText: true,
+            initialWidth: 50
         },
         {
             label: "娑堣�楀搧鍚嶇О",
@@ -349,28 +383,35 @@
             fieldName: "Bar_Code__c",
             hideDefaultActions: true,
             wrapText: true,
-            initialWidth: 500
+            initialWidth: 400
         },
         {
             label: "浣跨敤鏈熼檺",
             fieldName: "Sterilization_limit__c",
             hideDefaultActions: true,
             wrapText: true,
+            initialWidth: 120
         },
         {
             label: "鍑鸿揣鏁伴噺",
-            fieldName: "outboundCount",
+            fieldName: 'outboundCount',
             hideDefaultActions: true,
-            wrapText: true,
-        },
+            cellAttributes: { alignment: "right" },
+        }
     ];
     @track salesData = [];
 
     @track salesErrorColumns = [
         {
             label: "娑堣�楀搧璁㈠崟",
-            fieldName: "Consumable_order_minor__c",
+            fieldName: "ConsumableorderminorUrl",
             hideDefaultActions: true,
+            type: "url",
+            initialWidth: 210,
+            typeAttributes: {
+                label: { fieldName: "Consumable_order_minor__c" },
+                target: "_blank",
+            },
             wrapText: true,
         },
         {
@@ -378,6 +419,7 @@
             fieldName: "orderdetails2Name",
             hideDefaultActions: true,
             wrapText: true,
+            initialWidth: 240
         },
         {
             label: "娑堣�楀搧鍚嶇О",
@@ -390,17 +432,21 @@
             fieldName: "Box_Piece__c",
             hideDefaultActions: true,
             wrapText: true,
+            initialWidth: 50
         },
         {
             label: "BarCode",
             fieldName: "Bar_Code__c",
             hideDefaultActions: true,
+            wrapText: true,
+            initialWidth: 400
         },
         {
             label: "浣跨敤鏈熼檺",
             fieldName: "Sterilization_limit__c",
             hideDefaultActions: true,
             wrapText: true,
+            initialWidth: 120
         },
         {
             label: "閿欒鍘熷洜",
@@ -526,6 +572,18 @@
             fieldName: "CreatedByName",
             hideDefaultActions: true,
         },
+        {
+            label: '',
+            type: 'tableCellIcon',
+            typeAttributes: {
+                iconName: 'utility:delete',
+                recordId: {
+                    fieldName: 'Id'
+                }
+            },
+            initialWidth: 50,
+            hideDefaultActions: true
+        },
     ];
     filesUploaded = [];
     fileContents;
@@ -539,7 +597,7 @@
     defaultSortDirection = 'asc';
     sortDirection = 'asc';
     sortedBy;
-    @track pageSize = 5;
+    @track pageSize = 10;
     error;
     records;
     currentPageToken = 0;
@@ -549,11 +607,26 @@
     @track pageNumber = 1;
     @track paginationVisibility = false;
     @track totalPages = 1;
-    pageSizeOptions = [5, 10, 25, 50, 75, 100];
+    pageSizeOptions = [10, 25, 50, 100];
     @track recordStart = 0;
     @track recordEnd = 0;
     //end
     @track SearchDone = '';
+    @track hideCheckboxColumn = false;
+
+    stylesLoaded = false;
+    renderedCallback() {
+        if (!this.stylesLoaded) {
+            Promise.all([loadStyle(this, WrappedHeaderTable)])
+                .then(() => {
+                    console.log("Custom styles loaded");
+                    this.stylesLoaded = true;
+                })
+                .catch((error) => {
+                    console.error("Error loading custom styles");
+                });
+        }
+    }
 
     //InvoiceProNotLabel    RrturnProLabel  InvoicedLabel
     @wire(getObjectInfo, { objectApiName: OPPORTUNITY_OBJECT })
@@ -585,8 +658,12 @@
         //statusEdit
         this.statusEdit = this.getQueryString("KeyWords");
         this.statusEdit = this.statusEdit == null ? "" : this.statusEdit;
+        //arriveorder
+        this.arriveorder = this.getQueryString("arriveorder");
+        this.arriveorder = this.arriveorder == null ? "" : this.arriveorder;
         console.log("this.ESetid = " + this.ESetid);
         console.log("this.statusEdit = " + this.statusEdit);
+        console.log("this.arriveorder = " + this.arriveorder);
         if (this.ESetid == "") {
             this.isShowInformation = false;
         }
@@ -595,7 +672,8 @@
             ESetidJs: this.ESetid,
             statusEdit: this.statusEdit,
             pageSizeLWC: this.pageSize,
-            pageTokenLWC: this.currentPageToken
+            pageTokenLWC: this.currentPageToken,
+            arriveorderLWC: this.arriveorder
         }).then((r) => {
             r = JSON.parse(JSON.stringify(r));
             console.log("r = " + JSON.stringify(r));
@@ -624,28 +702,14 @@
                 this.accountName = r.entity.accountName;
                 this.userWorkLocation = r.entity.userWorkLocation;
                 this.EditAble = r.entity.EditAble;
-                this.consumableorderdetails2Records =
-                    r.entity.consumableorderdetails2Records;
+                this.consumableorderdetails2Records = r.entity.consumableorderdetails2Records;
                 for (var i in this.consumableorderdetails2Records) {
-                    this.consumableorderdetails2Records[i]["ProdName"] =
-                        this.consumableorderdetails2Records[i].Prod.Name;
-                    this.consumableorderdetails2Records[i][
-                        "orderdetails2SerialLotNo__c"
-                    ] =
-                        this.consumableorderdetails2Records[i].orderdetails2.SerialLotNo__c;
-                    this.consumableorderdetails2Records[i][
-                        "orderdetails2TracingCode__c"
-                    ] =
-                        this.consumableorderdetails2Records[i].orderdetails2.TracingCode__c;
-                    this.consumableorderdetails2Records[i][
-                        "orderdetails2Sterilization_limit__c"
-                    ] =
-                        this.consumableorderdetails2Records[
-                            i
-                        ].orderdetails2.Sterilization_limit__c;
+                    this.consumableorderdetails2Records[i]["ProdName"] = this.consumableorderdetails2Records[i].Prod.Name;
+                    this.consumableorderdetails2Records[i]["orderdetails2SerialLotNo__c"] = this.consumableorderdetails2Records[i].orderdetails2.SerialLotNo__c;
+                    this.consumableorderdetails2Records[i]["orderdetails2TracingCode__c"] = this.consumableorderdetails2Records[i].orderdetails2.TracingCode__c;
+                    this.consumableorderdetails2Records[i]["orderdetails2Sterilization_limit__c"] = this.consumableorderdetails2Records[i].orderdetails2.Sterilization_limit__c;
                 }
-                this.isShowOutboundProductDetails =
-                    r.entity.consumableorderdetails2Count > 0 ? true : false;
+                this.isShowOutboundProductDetails = r.entity.consumableorderdetails2Count > 0 ? true : false;
                 console.log("this.agencyProType = " + this.agencyProType);
                 console.log("this.EditAble = " + this.EditAble);
                 //鏌ヨ闄勪欢
@@ -678,6 +742,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 = [];
@@ -691,15 +757,14 @@
                         this.data[i]["unitValue"] = this.data[i]["unitValue"] == null ? unitOptions[0].value : this.data[i]["unitValue"];
                         if (this.EditAble) {
                             this.data[i].orderdetails1["Box_Piece__c"] = this.data[i].orderdetails1["Box_Piece__c"] == null ? unitOptions[0].value : this.data[i].orderdetails1["Box_Piece__c"];
+                            this.data[i]["unitValue"] = this.data[i].orderdetails1["Box_Piece__c"] == null ? unitOptions[0].value : this.data[i].orderdetails1["Box_Piece__c"];
+                            console.log('this.data[i].orderdetails1["Box_Piece__c"] = ' + this.data[i].orderdetails1["Box_Piece__c"]);
                             this.data[i].orderdetails1["Shipment_Count__c"] = this.data[i].orderdetails1["Shipment_Count__c"] == null ? 0 : this.data[i].orderdetails1["Shipment_Count__c"];
                             this.data[i].orderdetails1["Delivery_List_RMB__c"] = this.data[i].orderdetails1["Delivery_List_RMB__c"] == null ? 0.0 : this.data[i].orderdetails1["Delivery_List_RMB__c"];
                         } else {
-                            this.data[i]["InvoiceProNot_count__c"] =
-                                this.data[i].orderdetails1.InvoiceProNot_count__c;
-                            this.data[i]["RrturnPro_count__c"] =
-                                this.data[i].orderdetails1.RrturnPro_count__c;
-                            this.data[i]["Invoiced_Procount__c"] =
-                                this.data[i].orderdetails1.Invoiced_Procount__c;
+                            this.data[i]["InvoiceProNot_count__c"] = this.data[i].orderdetails1.InvoiceProNot_count__c;
+                            this.data[i]["RrturnPro_count__c"] = this.data[i].orderdetails1.RrturnPro_count__c;
+                            this.data[i]["Invoiced_Procount__c"] = this.data[i].orderdetails1.Invoiced_Procount__c;
                         }
                         // this.data[i]["shipmentNumber"] = 0;
                         // this.data[i]["shippingUnitPrice"] = 0.0;
@@ -708,8 +773,18 @@
                         this.data[i]["shipmentNumber"] = this.data[i].orderdetails1["Shipment_Count__c"];
                         this.data[i]["shippingUnitPrice"] = this.data[i].orderdetails1["Delivery_List_RMB__c"];
 
-                        this.data[i]["recordId"] = this.data[i].Prod.Id;
+
+
                         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';
+                            } else {
+                                this.data[i]["Id"] = this.data[i].Prod.Id + 'nothos';
+                            }
+                        }
+                        this.data[i]["recordId"] = this.data[i].Prod.Id;
                         this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
                         this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c;
                         this.data[i]["Category3__c"] = this.data[i].Prod.Category3__c;
@@ -724,6 +799,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"];
@@ -742,9 +818,11 @@
                         this.editData[i]["Category5__c"] = this.editData[i].Prod.Category5__c;
                         this.editData[i]["Box_Piece__c"] = this.editData[i].orderdetails1.Box_Piece__c;
                         this.editData[i]["shipmentAmount"] = this.editData[i].orderdetails1.Shipment_amount__c;
-                        this.editData[i]["Shipment_amount__c"] = this.editData[i].orderdetails1.Shipment_amount__c;
+                        //this.editData[i]["Shipment_amount__c"] = this.editData[i].orderdetails1.Shipment_amount__c;
+                        this.editData[i]["Delivery_List_RMB__c"] = this.editData[i].orderdetails1.Delivery_List_RMB__c;
                         this.editData[i]["Shipment_Count__c"] = this.editData[i].orderdetails1.Shipment_Count__c;
                     }
+                    console.log('end this.editData = ' + JSON.stringify(this.editData));
                 }
 
                 console.log("this.data = " + JSON.stringify(this.data));
@@ -763,16 +841,26 @@
                 this.Existarrive = r.entity.Existarrive;
 
                 console.log("this.EditAble = " + this.EditAble);
-                this.hasHosPro = r.entity.hasHosPro;
+
                 //disable
 
+                debugger
                 if (Object.values(r.entity.coc).length > 0) {
                     this.cocLwc = r.entity.coc;
                     console.log("this.cocLwc = " + JSON.stringify(this.cocLwc));
                     var coc = r.entity.coc;
+                    this.accountValue = coc.Order_ForDealerText__c;
+                    this.ForDealerText = coc.Order_ForDealerText__c;
+                    console.log('this.accountValue = ' + this.accountValue);
                     this.cocId = coc.Id;
                     console.log('cocId = ' + this.cocId);
                     coc.SummonsStatus = coc.SummonsStatus_c__c;
+                    console.log('this.cocLwc.Arrive_Order__c = ' + this.cocLwc.Arrive_Order__c)
+                    if(this.cocLwc.Arrive_Order__c == null){
+                        this.isBarcode = true;
+                    }else{
+                        this.isBarcode = false;
+                    }
                     if (coc.SummonsStatus_c__c == "宸插畬鎴�") {
                         this.isEditDisabled = true;
                     }
@@ -800,10 +888,7 @@
                     ) {
                         this.isPraseToPDFDisabled = false;
                     }
-                    if (
-                        coc.Billed_Status__c != "杩樻病寮�绁�" ||
-                        coc.SummonsStatus_c__c == "宸插畬鎴�"
-                    ) {
+                    if ((coc.Billed_Status__c != "杩樻病寮�绁�" || coc.SummonsStatus_c__c == "宸插畬鎴�")) {
                         this.isOpenReportDisabled = false;
                     }
                     if (
@@ -880,6 +965,7 @@
                         label: this.InvoiceProNotLabel,
                         fieldName: "InvoiceProNot_count__c",
                         type: "number",
+                        initialWidth: 120,
                         typeAttributes: {
                             minimumFractionDigits: 2,
                         },
@@ -888,11 +974,14 @@
                     let object2 = {
                         label: this.RrturnProLabel,
                         fieldName: "RrturnPro_count__c",
+                        initialWidth: 100,
+                        cellAttributes: { alignment: "right" },
                         hideDefaultActions: true,
                     };
                     let object3 = {
                         label: this.InvoicedLabel,
                         fieldName: "Invoiced_Procount__c",
+                        initialWidth: 100,
                         type: "number",
                         typeAttributes: {
                             minimumFractionDigits: 2,
@@ -914,6 +1003,8 @@
                             this.isDisabledForCustomerText = false;
                             this.secondaryDistributor = "";
                             this.ForDealerText = "";
+                            this.accountValue = "";
+                            this.cocLwc['Order_ForDealerText__c'] = '';
                             this.isDisabledForDealerText = true;
                             this.isDisabledSecondaryDistributor = true;
                             break;
@@ -922,12 +1013,14 @@
                             this.isDisabledForCustomerText = false;
                             this.isDisabledForDealerText = false;
                             this.isDisabledSecondaryDistributor = false;
+                            this.isMutualTransferGoods = false;
                             break;
                         case "閿�鍞粰浜岀骇缁忛攢鍟�":
                             this.isDisabledHospitalName = false;
                             this.isDisabledForCustomerText = false;
                             this.isDisabledForDealerText = false;
                             this.isDisabledSecondaryDistributor = false;
+                            this.isMutualTransferGoods = false;
                             break;
                         case "浜掔浉璋冭揣":
                             this.isDisabledHospitalName = true;
@@ -935,6 +1028,7 @@
                             this.OECId = "";
                             this.isDisabledForCustomerText = true;
                             this.ForCustomerText = "";
+                            this.cocLwc["Order_ForCustomerText__c"] = "";
                             this.isDisabledForDealerText = false;
                             this.isDisabledSecondaryDistributor = false;
                             this.isMutualTransferGoods = true;
@@ -953,6 +1047,7 @@
                         label: "鍖婚櫌鐗逛环",
                         fieldName: "hospitalSpecialOffer",
                         type: 'boolean',
+                        initialWidth: 100,
                         hideDefaultActions: true,
                     };
                     this.columns.push(object1);
@@ -979,15 +1074,38 @@
                 );
                 this.HospitalName = r.entity.HospitalName;
                 this.sumPrice = r.entity.sumPrice.toFixed(2) + "鍏�";
+                debugger
+                console.log('this.Existarrive = ' + this.Existarrive);
+                console.log('this.EditAble = ' + this.EditAble);
+                console.log('r.entity.coc.SummonsStatus_c__c = ' + r.entity.coc.SummonsStatus_c__c);
+                if (!this.Existarrive && this.EditAble && r.entity.coc.SummonsStatus_c__c != '浠锋牸鏈畾') {
+                    this.hideCheckboxColumn = false;
+                } else {
+                    this.hideCheckboxColumn = true;
+                }
+                if (!(this.arriveorder == '' && this.Existarrive == false && this.EditAble && this.cocLwc.SummonsStatus_c__c != '浠锋牸鏈畾')) {
+                    //璁╁崟浣嶏紝鍑鸿揣鏁伴噺 鍙樹负涓嶅彲閫夌殑text绫诲瀷
+                    for (var i in this.columns) {
+                        if (this.columns[i].label == '鍗曚綅') {
+                            this.columns[i].type = 'text';
+                            this.columns[i].fieldName = 'unitValue';
+                        }
+                        if (this.columns[i].label == '鍑鸿揣鏁伴噺') {
+                            this.columns[i].type = 'text';
+                            this.columns[i].fieldName = 'shipmentNumber';
+                        }
+                    }
+                }
                 this.isShowSpinner = false;
                 this.showTable = true;
                 console.log("ESetid = " + this.ESetid);
             } else {
                 console.log("r = " + JSON.stringify(r));
-                this.showToast("Error", r.msg);
+                this.showMyToast('鍒濆鍖栧け璐�', r.msg, 'Error');
             }
         }).catch((error) => {
             console.log("error = " + JSON.stringify(error));
+            this.showMyToast('閿欒', '鍒濆鍖栧け璐�', 'Error');
         });
     }
 
@@ -1002,6 +1120,7 @@
                 this.isDisabledForCustomerText = false;
                 this.secondaryDistributor = "";
                 this.ForDealerText = "";
+                this.cocLwc['Order_ForDealerText__c'] = '';
                 this.isDisabledForDealerText = true;
                 this.isDisabledSecondaryDistributor = true;
                 this.isMutualTransferGoods = false;
@@ -1011,12 +1130,14 @@
                 this.isDisabledForCustomerText = false;
                 this.isDisabledForDealerText = false;
                 this.isDisabledSecondaryDistributor = false;
+                this.isMutualTransferGoods = false;
                 break;
             case "閿�鍞粰浜岀骇缁忛攢鍟�":
                 this.isDisabledHospitalName = false;
                 this.isDisabledForCustomerText = false;
                 this.isDisabledForDealerText = false;
                 this.isDisabledSecondaryDistributor = false;
+                this.isMutualTransferGoods = false;
                 break;
             case "浜掔浉璋冭揣":
                 this.isDisabledHospitalName = true;
@@ -1024,6 +1145,7 @@
                 this.OECId = "";
                 this.isDisabledForCustomerText = true;
                 this.ForCustomerText = "";
+                this.cocLwc["Order_ForCustomerText__c"] = "";
                 this.isDisabledForDealerText = false;
                 this.isDisabledSecondaryDistributor = false;
                 this.isMutualTransferGoods = true;
@@ -1033,6 +1155,7 @@
                 this.isDisabledForCustomerText = false;
                 this.isDisabledForDealerText = false;
                 this.isDisabledSecondaryDistributor = false;
+                this.isMutualTransferGoods = false;
         }
     }
 
@@ -1049,6 +1172,9 @@
                 break;
             case "HospitalName":
                 this.HospitalName = value;
+                break;
+            case "outOutPattern":
+                this.outOutPattern = value;
                 break;
             case "ForDealerText":
                 this.ForDealerText = value;
@@ -1095,6 +1221,9 @@
             case "Barcode":
                 this.Barcode = value;
                 break;
+            case "Order_ForDealerText__c":
+                this.cocLwc["Order_ForDealerText__c"] = value;
+                break;
         }
     }
 
@@ -1125,7 +1254,7 @@
                 }
             } else {
                 console.log("r = " + JSON.stringify(r));
-                this.showToast("Error", r.msg);
+                this.showMyToast('4/5鍒嗙被鏌ヨ澶辫触', r.msg, 'Error');
             }
         }).catch((error) => {
             console.log("error" + JSON.stringify(error));
@@ -1160,7 +1289,7 @@
                 }
             } else {
                 console.log("r = " + JSON.stringify(r));
-                this.showToast("Error", r.msg);
+                this.showMyToast('Error', r.msg, 'Error');
             }
         }).catch((error) => {
             console.log("error" + JSON.stringify(error));
@@ -1172,16 +1301,24 @@
         console.log('this.invoiceId = ' + this.invoiceId);
     }
 
-    showToast(type, msg) {
+    showMyToast(title, message, variant) {
         this.isShowSpinner = false;
         this.showLoadingSpinner = false;
         this.isEditShowSpinner = false;
-        const event = new ShowToastEvent({
-            title: type,
-            variant: type,
-            message: msg,
-        });
-        this.dispatchEvent(event);
+        console.log('show custom message');
+        var iconName = '';
+        var content = '';
+        if (variant.toLowerCase() == '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);
     }
 
     searchProductJs() {
@@ -1201,7 +1338,7 @@
             }
         }
 
-        let cloneData = this.data;
+        let cloneData = this.deepClone(this.data);
         for (var i in cloneData) {
             cloneData[i]["Name"] = cloneData[i].Name__c;
             cloneData[i]["Category3"] = cloneData[i].Category3__c;
@@ -1245,6 +1382,8 @@
                 this.totalPages = Math.ceil(r.entity.paginatedAccounts.totalRecords / this.pageSize);
                 console.log('this.totalPages = ' + this.totalPages);
 
+                this.hasHosPro = r.entity.hasHosPro;
+                console.log("this.hasHosPro = " + this.hasHosPro);
 
                 this.SearchDone = r.entity.SearchDone;
                 let tempData = [];
@@ -1262,6 +1401,7 @@
                     tempData[i]["unitValue"] = tempData[i]["unitValue"] == null ? unitOptions[0].value : tempData[i]["unitValue"];
                     if (this.EditAble) {
                         tempData[i].orderdetails1["Box_Piece__c"] = tempData[i].orderdetails1["Box_Piece__c"] == null ? unitOptions[0].value : tempData[i].orderdetails1["Box_Piece__c"];
+                        tempData[i]["unitValue"] = tempData[i].orderdetails1["Box_Piece__c"] == null ? unitOptions[0].value : tempData[i].orderdetails1["Box_Piece__c"];
                         tempData[i].orderdetails1["Shipment_Count__c"] = tempData[i].orderdetails1["Shipment_Count__c"] == null ? 0 : tempData[i].orderdetails1["Shipment_Count__c"];
                         tempData[i].orderdetails1["Delivery_List_RMB__c"] = tempData[i].orderdetails1["Delivery_List_RMB__c"] == null ? 0.0 : tempData[i].orderdetails1["Delivery_List_RMB__c"];
                     } else {
@@ -1275,13 +1415,18 @@
                     tempData[i]["shipmentNumber"] = tempData[i].orderdetails1["Shipment_Count__c"];
                     tempData[i]["shippingUnitPrice"] = tempData[i].orderdetails1["Delivery_List_RMB__c"];
 
-                    tempData[i]["recordId"] = tempData[i].Prod.Id;
+                    tempData[i]["Id"] = tempData[i].Prod.Id;
+
                     console.log('tempData[i]["hospitalSpecialOffer"] = ' + tempData[i]["hospitalSpecialOffer"])
-                    if (tempData[i]["hospitalSpecialOffer"]) {
-                        tempData[i]["Id"] = tempData[i].Prod.Id + 'ishos';
-                    } else {
-                        tempData[i]["Id"] = tempData[i].Prod.Id + 'nothos';
+                    if (this.hasHosPro) {
+                        if (tempData[i]["hospitalSpecialOffer"]) {
+                            tempData[i]["Id"] = tempData[i].Prod.Id + 'ishos';
+                        } else {
+                            tempData[i]["Id"] = tempData[i].Prod.Id + 'nothos';
+                        }
                     }
+
+                    tempData[i]["recordId"] = tempData[i]["Id"];
                     tempData[i]["Name__c"] = tempData[i].Prod.Name__c;
                     tempData[i]["SFDA_Status__c"] = tempData[i].Prod.SFDA_Status__c;
                     tempData[i]["Category3__c"] = tempData[i].Prod.Category3__c;
@@ -1305,13 +1450,30 @@
 
                 }
                 this.data = tempData;
+
+                //濡傛灉hasHosPro = true 鍖婚櫌鐗逛环
+                console.log('this.hasHosPro = ' + this.hasHosPro);
+                if (this.hasHosPro) {
+                    let object1 = {
+                        label: "鍖婚櫌鐗逛环",
+                        fieldName: "hospitalSpecialOffer",
+                        type: 'boolean',
+                        initialWidth: 100,
+                        hideDefaultActions: true,
+                    };
+                    this.columns.push(object1);
+                    this.editColumns.push(object1);
+                }
+                this.columns = [...this.columns];
+                this.editColumns = [...this.editColumns];
+                console.log("this.columns = " + JSON.stringify(this.columns));
                 console.log("this.data = " + JSON.stringify(this.data));
                 console.log(" this.selectedRows = " + JSON.stringify(this.selectedRows));
                 //this.showTable = true;
                 this.isEditShowSpinner = false;
             } else {
                 console.log("r = " + JSON.stringify(r));
-                this.showToast("Error", r.msg);
+                this.showMyToast('鏌ヨ澶辫触', r.msg, 'Error');
             }
         });
     }
@@ -1403,7 +1565,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;
             }
@@ -1417,14 +1579,28 @@
         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(
-                    numberDetail.data.shipmentnumber
-                );
+                this.data[i].orderdetails1["Shipment_Count__c"] = Number(numberDetail.data.shipmentnumber);
+                console.log('this.data[i].orderdetails1["Shipment_Count__c"] = ' + this.data[i].orderdetails1["Shipment_Count__c"]);
+                console.log('this.selectedRows.indexOf(this.data[i].Id) = ' + this.selectedRows.indexOf(this.data[i].Id));
+                if (this.data[i].orderdetails1["Shipment_Count__c"] != '') {
+                    if (this.selectedRows.indexOf(this.data[i].Id) == -1) {
+                        this.selectedRows.push(this.data[i].Id);
+                    }
+                    this.data[i].check = true;
+                } else {
+                    if (this.selectedRows.indexOf(this.data[i].Id) != -1) {
+                        this.selectedRows.splice(this.selectedRows.indexOf(this.data[i].Id), 1);
+                    }
+                    this.data[i].check = false;
+                }
+                this.selectedRows = [...this.selectedRows];
+                console.log('this.selectedRows = ' + JSON.stringify(this.selectedRows));
             }
         }
+        this.data = [...this.data];
         this.ComputePrice(
             index,
             this.data[index].shipmentNumber,
@@ -1437,7 +1613,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
@@ -1476,8 +1652,8 @@
         //     }
         // }
         this.data = [...this.data];
-        this.selectedRows = [...this.selectedRows]
-        console.log("this.selectedRows = " + JSON.stringify(this.selectedRows));
+        // this.selectedRows = [...this.selectedRows]
+        // console.log("this.selectedRows = " + JSON.stringify(this.selectedRows));
         console.log("this.data = " + JSON.stringify(this.data));
     }
 
@@ -1569,6 +1745,10 @@
         }
     }
 
+    deepClone(obj) {
+        return JSON.parse(JSON.stringify(obj));
+    }
+
     saveConfirm() {
         this.isShowSpinner = true;
 
@@ -1586,13 +1766,14 @@
             }
         }
 
-        let cloneData = this.data;
+        let cloneData = this.deepClone(this.data);
         for (var i in cloneData) {
             cloneData[i]["Name"] = cloneData[i].Name__c;
             cloneData[i]["Category3"] = cloneData[i].Category3__c;
             cloneData[i]["Category4"] = cloneData[i].Category4__c;
             cloneData[i]["Category5"] = cloneData[i].Category5__c;
             cloneData[i]["BoxPiece"] = cloneData[i].Box_Piece__c;
+            //cloneData[i]["shippingUnitPrice"] = cloneData[i]["shippingUnitPrice"] == '' ? 0 : cloneData[i]["shippingUnitPrice"];
             delete cloneData[i].Name__c;
             delete cloneData[i].Category3__c;
             delete cloneData[i].Category4__c;
@@ -1626,16 +1807,17 @@
             console.log("r = " + JSON.stringify(r));
             debugger
             if (r.status == "Success") {
-                let url = "/lexsummonscreat?ESetid=" + r.entity.ESetId;
-                this[NavigationMixin.Navigate]({
-                    type: "standard__webPage",
-                    attributes: {
-                        url: url,
-                    },
-                });
+                // let url = "/lexsummonscreat?ESetid=" + r.entity.ESetId;
+                // this[NavigationMixin.Navigate]({
+                //     type: "standard__webPage",
+                //     attributes: {
+                //         url: url,
+                //     },
+                // });
+                window.location.href = "/s/lexsummonscreat?ESetid=" + r.entity.ESetId;
             } else {
                 console.log("r.msg = " + r.msg);
-                this.showToast("Error", r.msg);
+                this.showMyToast('淇濆瓨澶辫触', r.msg, 'Error');
             }
         }).catch((error) => {
             console.log("error = " + JSON.stringify(error));
@@ -1656,7 +1838,7 @@
                 window.open("/customer/summonsPDF?ESetid=" + r.entity.ESetId);
             } else {
                 console.log("r.msg = " + r.msg);
-                this.showToast("Error", r.msg);
+                this.showMyToast('鎵撳嵃澶辫触', r.msg, 'Error');
             }
         });
     }
@@ -1666,15 +1848,20 @@
         console.log("openReportJs");
         var reportId = this.ESetid;
         reportId = reportId.substring(0, 15);
+        console.log("reportId = " + reportId);
         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 = "/s/report/" + reportUrl + "?reportFilters=" + encodeURIComponent(reportFilters);
         console.log("url = " + url);
-        this[NavigationMixin.Navigate]({
-            type: "standard__webPage",
-            attributes: {
-                url: url,
-            },
-        });
+        window.open(url);
+        // this[NavigationMixin.Navigate]({
+        //     type: "standard__webPage",
+        //     attributes: {
+        //         url: url,
+        //         target: '_blank'
+        //     },
+        // });
     }
 
     vpClear2Delay(event) {
@@ -1702,13 +1889,11 @@
         console.log("event.detail = " + JSON.stringify(event.detail));
         apexSearch({
             searchTerm: event.detail.searchTerm,
-        })
-            .then((results) => {
-                lookupElement.setSearchResults(results);
-            })
-            .catch((error) => {
-                console.log("error" + JSON.stringify(error));
-            });
+        }).then((results) => {
+            lookupElement.setSearchResults(results);
+        }).catch((error) => {
+            console.log("error" + JSON.stringify(error));
+        });
     }
 
     handleSelectionChange(event) {
@@ -1732,7 +1917,7 @@
         if (this.filesUploaded.length > 0) {
             this.file = this.filesUploaded[0];
             if (this.file.size > this.MAX_FILE_SIZE) {
-                this.showToast("Error", "鏂囦欢杩囧ぇ");
+                this.showMyToast('淇濆瓨澶辫触', '鏂囦欢杩囧ぇ', 'Error');
                 return;
             }
             this.showPopSpinner = true;
@@ -1758,20 +1943,18 @@
             recordId: this.ESetid,
             fileName: this.fileName,
             base64Data: encodeURIComponent(this.fileContents),
-        })
-            .then((r) => {
-                this.showPopSpinner = false;
-                r = JSON.parse(JSON.stringify(r));
-                console.log("r = " + JSON.stringify(r));
-                this.closePop();
-                this.showToast("Success", "涓婁紶鎴愬姛");
-                this.getFiles();
-            })
-            .catch((error) => {
-                this.showPopSpinner = false;
-                console.log("error = " + error.message);
-                this.showToast("Error", "涓婁紶澶辫触");
-            });
+        }).then((r) => {
+            this.showPopSpinner = false;
+            r = JSON.parse(JSON.stringify(r));
+            console.log("r = " + JSON.stringify(r));
+            this.closePop();
+            this.showMyToast('涓婁紶鎴愬姛', '', 'Success');
+            this.getFiles();
+        }).catch((error) => {
+            this.showPopSpinner = false;
+            console.log("error = " + error.message);
+            this.showMyToast('澶辫触', '涓婁紶澶辫触', 'Error');
+        });
     }
 
     getFiles() {
@@ -1779,22 +1962,25 @@
         this.showLoadingSpinner = true;
         getFiles({
             recordId: this.ESetid,
-        })
-            .then((r) => {
-                r = JSON.parse(JSON.stringify(r));
-                console.log("r = " + JSON.stringify(r));
-                this.fileData = r.entity.cvList;
-                for (var i in this.fileData) {
-                    this.fileData[i]["CreatedByName"] = this.fileData[i].CreatedBy.Name;
-                    this.fileData[i]["url"] = "/" + this.fileData[i].Id;
-                }
-                console.log("this.fileData = " + this.fileData);
-                this.showLoadingSpinner = false;
-            })
-            .catch((error) => {
-                console.log("error = " + error.message);
-                this.showToast("Error", "鑾峰彇闄勪欢澶辫触");
-            });
+        }).then((r) => {
+            r = JSON.parse(JSON.stringify(r));
+            console.log("r = " + JSON.stringify(r));
+            this.fileData = r.entity.cvList;
+            console.log("this.fileData = " + JSON.stringify(this.fileData));
+            for (var i in this.fileData) {
+                this.fileData[i]["Id"] = this.fileData[i].Id;
+                this.fileData[i]["recordId"] = this.fileData[i].Id;
+                this.fileData[i]["url"] = "/" + this.fileData[i].Id;
+                this.fileData[i]["Title"] = this.fileData[i].Title;
+                this.fileData[i]["attUrl"] = '/' + this.fileData[i].Id;
+                this.fileData[i]['downloadUrl'] = '/sfc/servlet.shepherd/document/download/' + this.fileData[i].ContentDocumentId + '?operationContext=S1';
+            }
+            console.log("this.fileData = " + this.fileData);
+            this.showLoadingSpinner = false;
+        }).catch((error) => {
+            console.log("error = " + error.message);
+            this.showMyToast('澶辫触', '鑾峰彇闄勪欢澶辫触', 'Error');
+        });
     }
 
     GoodsDeliveryJs() {
@@ -1814,7 +2000,7 @@
             }
         }
 
-        let cloneData = this.data;
+        let cloneData = this.deepClone(this.data);
         for (var i in cloneData) {
             cloneData[i]["Name"] = cloneData[i].Name__c;
             cloneData[i]["Category3"] = cloneData[i].Category3__c;
@@ -1832,58 +2018,89 @@
             cocLwc: this.cocLwc,
             ESetId: this.ESetid,
             pageRecordsLwcLwc: cloneData,
-        })
-            .then((r) => {
-                r = JSON.parse(JSON.stringify(r));
-                console.log("r = " + JSON.stringify(r));
-                if (r.status == "Success") {
-                    console.log(
-                        "Summons_Order_type__c = " + this.cocLwc["Summons_Order_type__c"]
-                    );
-                    this.isSales =
-                        this.cocLwc["Summons_Order_type__c"] == "閿�鍞�" ? true : false;
-                    this.GoodsDeliveryInit();
-                } else {
-                    console.log("r.msg = " + r.msg);
-                    this.showToast("Error", r.msg);
-                }
-                this.isShippingSales = true;
-            })
-            .catch((error) => {
-                console.log("error = " + error.message);
-                this.showToast("Error", "璺宠浆澶辫触");
-            });
+        }).then((r) => {
+            r = JSON.parse(JSON.stringify(r));
+            console.log("r = " + JSON.stringify(r));
+            if (r.status == "Success") {
+                console.log(
+                    "Summons_Order_type__c = " + this.cocLwc["Summons_Order_type__c"]
+                );
+                this.isSales = this.cocLwc["Summons_Order_type__c"] == "閿�鍞�" ? true : false;
+                this.GoodsDeliveryInit();
+            } else {
+                console.log("r.msg = " + r.msg);
+                this.showMyToast('閿欒', r.msg, 'Error');
+            }
+            this.isShippingSales = true;
+        }).catch((error) => {
+            console.log("error = " + error.message);
+            this.showMyToast('澶辫触', '璺宠浆澶辫触', 'Error');
+        });
     }
 
     GoodsDeliveryInit() {
         console.log("GoodsDeliveryInit");
         GoodsDeliveryInit({
             ESetId: this.ESetid,
-        })
-            .then((r) => {
-                r = JSON.parse(JSON.stringify(r));
-                console.log("r = " + JSON.stringify(r));
-                if (r.status == "Success") {
-                    this.salesCoc = r.entity.coc;
-                    this.salesAccountName = r.entity.accountName;
-                    this.salesUserWorkLocation = r.entity.userWorkLocation;
-                    this.salesAccountid = r.entity.accountid;
-                    this.salesOrderdetails = r.entity.orderdetails;
-                    this.salesData = r.entity.consumableorderdetailsRecords;
-                    this.salesErrorData = r.entity.consumableorderdetailsRecordserror;
-                    this.salesOrderpieceorboxMap = r.entity.orderpieceorboxMap;
-                    this.salesOrderpriceMap = r.entity.orderpriceMap;
-                    this.salesOrderagencypriceMap = r.entity.orderagencypriceMap;
-                    this.isShowSpinner = false;
-                } else {
-                    console.log("r.msg = " + r.msg);
-                    this.showToast("Error", r.msg);
+        }).then((r) => {
+            r = JSON.parse(JSON.stringify(r));
+            console.log("r = " + JSON.stringify(r));
+            if (r.status == "Success") {
+                this.salesCoc = r.entity.coc;
+                this.salesAccountName = r.entity.accountName;
+                this.salesUserWorkLocation = r.entity.userWorkLocation;
+                this.salesAccountid = r.entity.accountid;
+                this.salesOrderdetails = r.entity.orderdetails;
+                console.log('this.salesOrderdetails = ' + JSON.stringify(this.salesOrderdetails))
+                this.salesData = r.entity.consumableorderdetailsRecords;
+                console.log('this.salesData = ' + JSON.stringify(this.salesData))
+                this.salesErrorData = r.entity.consumableorderdetailsRecordserror;
+                this.salesOrderpieceorboxMap = r.entity.orderpieceorboxMap;
+                this.salesOrderpriceMap = r.entity.orderpriceMap;
+                this.salesOrderagencypriceMap = r.entity.orderagencypriceMap;
+                for (var i in this.salesData) {
+                    this.salesData[i]["Id"] = this.salesData[i].orderdetails2.Id;
+                    this.salesData[i]["Consumable_order_minor__c"] = this.salesData[i].orderdetails2.Consumable_order_minor__r != null ? this.salesData[i].orderdetails2.Consumable_order_minor__r.Name : '';
+                    this.salesData[i]["ConsumableorderminorUrl"] = this.salesData[i].orderdetails2.Consumable_order_minor__c != null ? "/" + this.salesData[i].orderdetails2.Consumable_order_minor__c : '';
+                    this.salesData[i]["orderdetails2Name"] = this.salesData[i].orderdetails2.Name;
+                    this.salesData[i]["orderdetails2NameUrl"] = "/" + this.salesData[i].orderdetails2.Id;
+                    this.salesData[i]["Box_Piece__c"] = this.salesData[i].orderdetails2.Box_Piece__c;
+                    this.salesData[i]["ProdName"] = this.salesData[i].Prod.Name;
+                    this.salesData[i]["Deliver_date__c"] = this.salesData[i].orderdetails2.Deliver_date__c;
+                    this.salesData[i]["Bar_Code__c"] = this.salesData[i].orderdetails2.Bar_Code__c;
+                    this.salesData[i]["Sterilization_limit__c"] = this.salesData[i].orderdetails2.Sterilization_limit__c;
+                    if (this.salesData[i]["Box_Piece__c"] == '鐩�') {
+                        console.log('this.salesData[i] = ' + JSON.stringify(this.salesData[i]))
+                        this.salesData[i]["outboundCount"] = this.salesData[i].outboundCount;
+                    } else {
+                        for (var j in this.salesOrderdetails) {
+                            console.log('this.salesOrderdetails[j].Consumable_product__c = ' + this.salesOrderdetails[j].Consumable_product__c);
+                            console.log('this.salesData[i].orderdetails2.Consumable_product__c = ' + this.salesData[i].orderdetails2.Consumable_product__c);
+                            if (this.salesOrderdetails[j].Consumable_product__c == this.salesData[i].orderdetails2.Consumable_product__c) {
+                                this.salesData[i]["outboundCount"] = this.salesOrderdetails[j].Shipment_Count__c;
+                            }
+                        }
+                    }
                 }
-            })
-            .catch((error) => {
-                console.log("error = " + error.message);
-                this.showToast("Error", "鍒濆鍖栧け璐�");
-            });
+                for (var i in this.salesErrorData) {
+                    this.salesErrorData[i]["Id"] = this.salesErrorData[i].orderdetails2.Id;
+                    this.salesErrorData[i]["Consumable_order_minor__c"] = this.salesErrorData[i].orderdetails2.Consumable_order_minor__r != null ? this.salesErrorData[i].orderdetails2.Consumable_order_minor__r.Name : '';
+                    this.salesErrorData[i]["ConsumableorderminorUrl"] = this.salesErrorData[i].orderdetails2.Consumable_order_minor__c != null ? "/" + this.salesErrorData[i].orderdetails2.Consumable_order_minor__c : '';
+                    this.salesErrorData[i]["orderdetails2Name"] = this.salesErrorData[i].orderdetails2.Name;
+                    this.salesErrorData[i]["ProdName"] = this.salesErrorData[i].Prod.Name;
+                    this.salesErrorData[i]["Box_Piece__c"] = this.salesErrorData[i].orderdetails2.Box_Piece__c;
+                    this.salesErrorData[i]["Bar_Code__c"] = this.salesErrorData[i].orderdetails2.Bar_Code__c;
+                    this.salesErrorData[i]["Sterilization_limit__c"] = this.salesErrorData[i].orderdetails2.Sterilization_limit__c;
+                }
+                this.isShowSpinner = false;
+            } else {
+                console.log("r.msg = " + r.msg);
+                this.showMyToast('鍒濆鍖栧け璐�', r.msg, 'Error');
+            }
+        }).catch((error) => {
+            console.log("error = " + error.message);
+            this.showMyToast('閿欒', '鍒濆鍖栧け璐�', 'Error');
+        });
     }
 
     SalesearchProductJs() {
@@ -1897,61 +2114,84 @@
             accountid: this.salesAccountid,
             orderdetails: this.salesOrderdetails,
             orderpieceorboxMap: this.salesOrderpieceorboxMap,
-        })
-            .then((r) => {
-                r = JSON.parse(JSON.stringify(r));
-                console.log("r = " + JSON.stringify(r));
-                if (r.status == "Success") {
-                    console.log("SearchPro success");
-                    this.salesErrorData = r.entity.consumableorderdetailsRecordserror;
-                    this.salesData = r.entity.consumableorderdetailsRecords;
-                    for (var i in this.salesErrorData) {
-                        this.salesErrorData[i]["Consumable_order_minor__c"] =
-                            this.salesErrorData[i].orderdetails2.Consumable_order_minor__c;
-                        this.salesErrorData[i]["orderdetails2Name"] =
-                            this.salesErrorData[i].orderdetails2.Name;
-                        this.salesErrorData[i]["ProdName"] =
-                            this.salesErrorData[i].Prod.Name;
-                        this.salesErrorData[i]["Box_Piece__c"] =
-                            this.salesErrorData[i].orderdetails2.Box_Piece__c;
-                        this.salesErrorData[i]["Bar_Code__c"] =
-                            this.salesErrorData[i].orderdetails2.Bar_Code__c;
-                        this.salesErrorData[i]["Sterilization_limit__c"] =
-                            this.salesErrorData[i].orderdetails2.Sterilization_limit__c;
-                    }
-                    for (var i in this.salesData) {
-                        this.salesData[i]["Consumable_order_minor__c"] =
-                            this.salesData[i].orderdetails2.Consumable_order_minor__c;
-                        this.salesData[i]["orderdetails2Name"] =
-                            this.salesData[i].orderdetails2.Name;
-                        this.salesData[i]["orderdetails2NameUrl"] =
-                            "/" + this.salesData[i].orderdetails2.Id;
-                        this.salesData[i]["Box_Piece__c"] =
-                            this.salesData[i].orderdetails2.Box_Piece__c;
-                        this.salesData[i]["ProdName"] = this.salesData[i].Prod.Name;
-                        this.salesData[i]["Deliver_date__c"] =
-                            this.salesData[i].orderdetails2.Deliver_date__c;
-                        this.salesData[i]["Bar_Code__c"] =
-                            this.salesData[i].orderdetails2.Bar_Code__c;
-                        this.salesData[i]["Sterilization_limit__c"] =
-                            this.salesData[i].orderdetails2.Sterilization_limit__c;
-                    }
-                    this.isShowSpinner = false;
-                } else {
-                    console.log("r.msg = " + r.msg);
-                    this.showToast("Error", r.msg);
+        }).then((r) => {
+            r = JSON.parse(JSON.stringify(r));
+            console.log("r = " + JSON.stringify(r));
+            if (r.status == "Success") {
+                console.log("SearchPro success");
+                this.salesErrorData = r.entity.consumableorderdetailsRecordserror;
+                this.salesData = r.entity.consumableorderdetailsRecords;
+                for (var i in this.salesErrorData) {
+                    this.salesErrorData[i]["Id"] = this.salesErrorData[i].orderdetails2.Id;
+                    this.salesErrorData[i]["Consumable_order_minor__c"] = this.salesErrorData[i].orderdetails2.Consumable_order_minor__r != null ? this.salesErrorData[i].orderdetails2.Consumable_order_minor__r.Name : '';
+                    this.salesErrorData[i]["ConsumableorderminorUrl"] = this.salesErrorData[i].orderdetails2.Consumable_order_minor__c != null ? "/" + this.salesErrorData[i].orderdetails2.Consumable_order_minor__c : '';
+                    this.salesErrorData[i]["orderdetails2Name"] = this.salesErrorData[i].orderdetails2.Name;
+                    this.salesErrorData[i]["ProdName"] = this.salesErrorData[i].Prod.Name;
+                    this.salesErrorData[i]["Box_Piece__c"] = this.salesErrorData[i].orderdetails2.Box_Piece__c;
+                    this.salesErrorData[i]["Bar_Code__c"] = this.salesErrorData[i].orderdetails2.Bar_Code__c;
+                    this.salesErrorData[i]["Sterilization_limit__c"] = this.salesErrorData[i].orderdetails2.Sterilization_limit__c;
                 }
-            })
-            .catch((error) => {
-                console.log("error = " + JSON.stringify(error.message));
-                this.showToast("Error", "鍒濆鍖栧け璐�");
-            });
+                console.log('this.salesData = ' + JSON.stringify(this.salesData));
+                for (var i in this.salesData) {
+                    this.salesData[i]["Id"] = this.salesData[i].orderdetails2.Id;
+                    this.salesData[i]["Consumable_order_minor__c"] = this.salesData[i].orderdetails2.Consumable_order_minor__r != null ? this.salesData[i].orderdetails2.Consumable_order_minor__r.Name : '';
+                    this.salesData[i]["ConsumableorderminorUrl"] = this.salesData[i].orderdetails2.Consumable_order_minor__c != null ? "/" + this.salesData[i].orderdetails2.Consumable_order_minor__c : '';
+                    this.salesData[i]["orderdetails2Name"] = this.salesData[i].orderdetails2.Name;
+                    this.salesData[i]["orderdetails2NameUrl"] = "/" + this.salesData[i].orderdetails2.Id;
+                    this.salesData[i]["Box_Piece__c"] = this.salesData[i].orderdetails2.Box_Piece__c;
+                    this.salesData[i]["ProdName"] = this.salesData[i].Prod.Name;
+                    this.salesData[i]["Deliver_date__c"] = this.salesData[i].orderdetails2.Deliver_date__c;
+                    this.salesData[i]["Bar_Code__c"] = this.salesData[i].orderdetails2.Bar_Code__c;
+                    this.salesData[i]["Sterilization_limit__c"] = this.salesData[i].orderdetails2.Sterilization_limit__c;
+                    if (this.salesData[i]["Box_Piece__c"] == '鐩�') {
+                        console.log('this.salesData[i] = ' + JSON.stringify(this.salesData[i]))
+                        this.salesData[i]["outboundCount"] = this.salesData[i].outboundCount;
+                    } else {
+                        for (var j in this.salesOrderdetails) {
+                            console.log('this.salesOrderdetails[j].Consumable_product__c = ' + this.salesOrderdetails[j].Consumable_product__c);
+                            console.log('this.salesData[i].orderdetails2.Consumable_product__c = ' + this.salesData[i].orderdetails2.Consumable_product__c);
+                            if (this.salesOrderdetails[j].Consumable_product__c == this.salesData[i].orderdetails2.Consumable_product__c) {
+                                this.salesData[i]["outboundCount"] = this.salesOrderdetails[j].Shipment_Count__c;
+                            }
+                        }
+                    }
+
+                    //salescolomus
+                    // console.log('this.salesData[i]["Box_Piece__c"] = ' + this.salesData[i]["Box_Piece__c"])
+                    // if (this.salesData[i]["Box_Piece__c"] == '鐩�') {
+                    //     this.salesData[i]["isDisable"] = true;
+                    //     this.salesData[i]["count"] = this.salesData[i].outboundCount;
+                    // }
+                    // if (this.salesData[i]["Box_Piece__c"] == '涓�') {
+                    //     this.salesData[i]["isDisable"] = false;
+                    // }
+                }
+                this.salesColumns = [...this.salesColumns];
+                this.isShowSpinner = false;
+            } else {
+                console.log("r.msg = " + r.msg);
+                this.showMyToast('鑾峰彇澶辫触', r.msg, 'Error');
+            }
+        }).catch((error) => {
+            console.log("error = " + JSON.stringify(error.message));
+        });
+    }
+
+    handleOutboundCount(event) {
+        let outboundDetail = event.detail;
+        for (var i in this.salesData) {
+            if (this.salesData[i].Id == outboundDetail.data.recordId) {
+                this.salesData[i]['outboundCount'] = outboundDetail.data.count
+            }
+        }
+        console.log('this.salesData = ' + JSON.stringify(this.salesData))
     }
 
     SaveP() {
         let cloneSalesData = this.salesData;
         for (var i in cloneSalesData) {
             delete cloneSalesData[i].Consumable_order_minor__c;
+            delete cloneSalesData[i].ConsumableorderminorUrl;
             delete cloneSalesData[i].orderdetails2Name;
             delete cloneSalesData[i].orderdetails2NameUrl;
             delete cloneSalesData[i].Box_Piece__c;
@@ -1963,15 +2203,15 @@
         }
         this.isShowSpinner = true;
         ProSale({
-            ESetId: this.ESetid,
+            ESetIdLwc: this.ESetid,
             cocLwc: this.salesCoc,
             barcodeLwc: this.Barcode,
-            accountName: this.salesAccountName,
-            userWorkLocation: this.salesUserWorkLocation,
+            accountNameLwc: this.salesAccountName,
+            userWorkLocationLwc: this.salesUserWorkLocation,
             consumableorderdetailsRecordsLwc: JSON.stringify(cloneSalesData),
-            orderdetails: this.salesOrderdetails,
-            orderpriceMap: this.salesOrderpriceMap,
-            orderagencypriceMap: this.salesOrderagencypriceMap,
+            orderdetailsLwc: this.salesOrderdetails,
+            orderpriceMapLwc: this.salesOrderpriceMap,
+            orderagencypriceMapLwc: this.salesOrderagencypriceMap,
         }).then((r) => {
             r = JSON.parse(JSON.stringify(r));
             console.log("r = " + JSON.stringify(r));
@@ -1986,13 +2226,12 @@
                 });
             } else {
                 console.log("r.msg = " + r.msg);
-                this.showToast("Error", r.msg);
+                this.showMyToast('閿�鍞け璐�', r.msg, 'Error');
             }
-        })
-            .catch((error) => {
-                console.log("error = " + JSON.stringify(error.message));
-                this.showToast("Error", "ProSale2澶辫触");
-            });
+        }).catch((error) => {
+            console.log("error = " + JSON.stringify(error.message));
+            this.showMyToast('閿欒', '閿�鍞け璐�', 'Error');
+        });
     }
 
     SaveE() {
@@ -2010,15 +2249,15 @@
         }
         this.isShowSpinner = true;
         ProdElivery({
-            ESetId: this.ESetid,
+            ESetIdLwc: this.ESetid,
             cocLwc: this.salesCoc,
             barcodeLwc: this.Barcode,
-            accountName: this.salesAccountName,
-            userWorkLocation: this.salesUserWorkLocation,
+            accountNameLwc: this.salesAccountName,
+            userWorkLocationLwc: this.salesUserWorkLocation,
             consumableorderdetailsRecordsLwc: JSON.stringify(cloneSalesData),
-            orderdetails: this.salesOrderdetails,
-            orderpriceMap: this.salesOrderpriceMap,
-            orderagencypriceMap: this.salesOrderagencypriceMap,
+            orderdetailsLwc: this.salesOrderdetails,
+            orderpriceMapLwc: this.salesOrderpriceMap,
+            orderagencypriceMapLwc: this.salesOrderagencypriceMap,
         }).then((r) => {
             r = JSON.parse(JSON.stringify(r));
             console.log("r = " + JSON.stringify(r));
@@ -2033,13 +2272,12 @@
                 });
             } else {
                 console.log("r.msg = " + r.msg);
-                this.showToast("Error", r.msg);
+                this.showMyToast('鍑鸿揣澶辫触', r.msg, 'Error');
             }
-        })
-            .catch((error) => {
-                console.log("error = " + JSON.stringify(error.message));
-                this.showToast("Error", "鍒濆鍖栧け璐�");
-            });
+        }).catch((error) => {
+            console.log("error = " + JSON.stringify(error.message));
+            this.showMyToast('閿欒', '鍑鸿揣澶辫触', 'Error');
+        });
     }
 
     //鍙戠エ
@@ -2047,16 +2285,18 @@
         let url = '';
         console.log('this.invoiceId = ' + this.invoiceId);
         if (this.invoiceId.length > 0 && this.invoiceId != '000000000000000') {
-            url = "/lexconinvoiceview?deliveryId=" + this.ESetid + "&invoiceId=" + this.invoiceId + "&KeyWords=Redirect";
+            url = "/s/lexconinvoiceview?deliveryId=" + this.ESetid + "&invoiceId=" + this.invoiceId + "&KeyWords=Redirect";
         } else {
-            url = "/lexconinvoiceview?deliveryId=" + this.ESetid + "&KeyWords=Redirect";
+            url = "/s/lexconinvoiceview?deliveryId=" + this.ESetid + "&KeyWords=Redirect";
         }
-        this[NavigationMixin.Navigate]({
-            type: "standard__webPage",
-            attributes: {
-                url: url,
-            },
-        });
+        window.open(url);
+        // this[NavigationMixin.Navigate]({
+        //     type: "standard__webPage",
+        //     attributes: {
+        //         url: url,
+        //         target:'_blank'
+        //     },
+        // });
     }
 
     //鍒犻櫎
@@ -2077,11 +2317,11 @@
                 });
             } else {
                 console.log("r.msg = " + r.msg);
-                this.showToast("Error", r.msg);
+                this.showMyToast('鍒犻櫎澶辫触', r.msg, 'Error');
             }
         }).catch((error) => {
             console.log("error = " + error.message);
-            this.showToast("Error", "璺宠浆澶辫触");
+            this.showMyToast('閿欒', '鍒犻櫎澶辫触', 'Error');
         });
     }
 
@@ -2168,11 +2408,11 @@
     sortBy(field, reverse, primer) {
         const key = primer
             ? function (x) {
-                  return primer(x[field]);
-              }
+                return primer(x[field]);
+            }
             : function (x) {
-                  return x[field];
-              };
+                return x[field];
+            };
 
         return function (a, b) {
             a = key(a);
@@ -2182,33 +2422,33 @@
     }
 
     onHandleSort(event) {
-        
+
         //灏嗗凡缁忛�夊ソ浜嗙殑鏀惧埌鍓嶉潰锛屼笉杩涜鎺掑簭
-        if(this.EditAble){
+        if (this.EditAble) {
             const { fieldName: sortedBy, sortDirection } = event.detail;
             const cloneData = [...this.data];
             cloneData.sort(this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1));
             let index = 0;
             let selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
             let selectedRowsIds = [];
-            for(var i in selectedRows){
+            for (var i in selectedRows) {
                 selectedRowsIds.push(selectedRows[i].Id);
             }
             console.log('selectedRowsIds = ' + JSON.stringify(selectedRowsIds));
-            for(var i = 0;i < cloneData.length ; i++){
-                if(selectedRowsIds.indexOf(cloneData[i].Id) != -1){
-                    if(i != 0){
+            for (var i = 0; i < cloneData.length; i++) {
+                if (selectedRowsIds.indexOf(cloneData[i].Id) != -1) {
+                    if (i != 0) {
                         let temp = cloneData[index];
                         cloneData[index] = cloneData[i];
                         cloneData[i] = temp;
-                    } 
+                    }
                     index++;
                 }
             }
             this.data = cloneData;
             this.sortDirection = sortDirection;
             this.sortedBy = sortedBy;
-        }else{
+        } else {
             const { fieldName: sortedBy, sortDirection } = event.detail;
             const cloneData = [...this.editData];
             cloneData.sort(this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1));
@@ -2272,7 +2512,7 @@
         this.searchEditProductJs();
     }
 
-    searchEditProductJs(){
+    searchEditProductJs() {
         this.isEditShowSpinner = true;
         this.showTable = false;
         init({
@@ -2312,17 +2552,18 @@
                     this.editData[i]["Category5__c"] = this.editData[i].Prod.Category5__c;
                     this.editData[i]["Box_Piece__c"] = this.editData[i].orderdetails1.Box_Piece__c;
                     this.editData[i]["shipmentAmount"] = this.editData[i].orderdetails1.Shipment_amount__c;
-                    this.editData[i]["Shipment_amount__c"] = this.editData[i].orderdetails1.Shipment_amount__c;
+                    //this.editData[i]["Shipment_amount__c"] = this.editData[i].orderdetails1.Shipment_amount__c;
+                    this.editData[i]["Delivery_List_RMB__c"] = this.editData[i].orderdetails1.Delivery_List_RMB__c;
                     this.editData[i]["Shipment_Count__c"] = this.editData[i].orderdetails1.Shipment_Count__c;
                 }
                 this.showTable = true;
                 this.isEditShowSpinner = false;
             } else {
                 console.log("r = " + JSON.stringify(r));
-                this.showToast("Error", r.msg);
+                this.showMyToast('鎼滅储澶辫触', r.msg, 'Error');
             }
         }).catch((error) => {
-            console.log("error = " + JSON.stringify(error));
+            this.showMyToast('閿欒', '鎼滅储澶辫触', 'Error');
         });
     }
 
@@ -2333,4 +2574,25 @@
     get nextButtonDisabled() {
         return this.nextPageToken === undefined;
     }
+
+    //鍒犻櫎闄勪欢
+    deleteAtt(event) {
+        this.isShowSpinner = true;
+        //var recordId = event.detail.data.recordId;
+        var recordId = event.target.getAttribute("data-fileid");
+        console.log('attid:' + recordId);
+        deleteAtt({
+            contentVersionId: recordId
+        }).then(r => {
+            r = JSON.parse(JSON.stringify(r));
+            if (r.status == "Success") {
+                this.showMyToast('鍒犻櫎鎴愬姛', '', 'Success');
+                this.getFiles();
+            } else {
+                this.showMyToast('鍒犻櫎澶辫触', r.msg, 'Error');
+            }
+        }).catch(error => {
+            this.showMyToast('閿欒', error.message, 'Error');
+        })
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.1