buli
2023-07-13 a046b3fe914e46147334d33bbdcb21e2759a3c43
force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
@@ -19,16 +19,16 @@
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 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";
import ConsumableOutboundReportId from '@salesforce/label/c.ConsumableOutboundReportId';
const customLabel = {
  ConsumableOutboundReportId
};
}
export default class LexSummonsCreat extends NavigationMixin(LightningElement) {
  @track label = customLabel;
@@ -38,16 +38,16 @@
  @track results = [
    {
      Id: "1",
      Name: "z"
            Name: "z",
    },
    {
      Id: "2",
      Name: "h"
            Name: "h",
    },
    {
      Id: "3",
      Name: "j"
    }
            Name: "j",
        },
  ];
  @track COLS = [
@@ -55,9 +55,9 @@
      label: "Account Name",
      type: "customName",
      typeAttributes: {
        accountName: { fieldName: "Name" }
      }
    }
                accountName: { fieldName: "Name" },
            },
        },
  ];
  @track columns = [
    {
@@ -74,28 +74,28 @@
      cellAttributes: { alignment: "right" },
      wrapText: true,
      initialWidth: 50,
      hideDefaultActions: true
            hideDefaultActions: true,
    },
    {
      label: "CFDA状态",
      fieldName: "SFDA_Status__c",
      initialWidth: 105,
      wrapText: true,
      hideDefaultActions: true
            hideDefaultActions: true,
    },
    {
      label: "注册证编码号",
      fieldName: "approbation_No",
      wrapText: true,
      initialWidth: 105,
      hideDefaultActions: true
            hideDefaultActions: true,
    },
    {
      label: "注册证效期",
      wrapText: true,
      initialWidth: 115,
      fieldName: "expiration_Date",
      hideDefaultActions: true
            hideDefaultActions: true,
    },
    {
      label: "第3分类",
@@ -103,7 +103,7 @@
      wrapText: true,
      initialWidth: 115,
      hideDefaultActions: true,
      sortable: true
            sortable: true,
    },
    {
      label: "第4分类",
@@ -111,7 +111,7 @@
      wrapText: true,
      initialWidth: 115,
      hideDefaultActions: true,
      sortable: true
            sortable: true,
    },
    {
      label: "第5分类",
@@ -119,7 +119,7 @@
      wrapText: true,
      initialWidth: 115,
      hideDefaultActions: true,
      sortable: true
            sortable: true,
    },
    {
      label: "单位",
@@ -129,7 +129,7 @@
      typeAttributes: {
        unitValue: { fieldName: "unitValue" },
        unitOptions: { fieldName: "unitOptions" },
        recordId: { fieldName: "Id" }
                recordId: { fieldName: "Id" },
      }
    },
    {
@@ -140,8 +140,8 @@
      cellAttributes: { alignment: "right" },
      typeAttributes: {
        recordId: { fieldName: "Id" },
        shipmentNumber: { fieldName: "shipmentNumber" }
      }
                shipmentNumber: { fieldName: "shipmentNumber" },
            },
    },
    {
      label: "出货单价(元)",
@@ -150,8 +150,8 @@
      initialWidth: 120,
      typeAttributes: {
        recordId: { fieldName: "Id" },
        shippingUnitPrice: { fieldName: "shippingUnitPrice" }
      }
                shippingUnitPrice: { fieldName: "shippingUnitPrice" },
            },
    },
    {
      label: "出货金额(元)",
@@ -160,8 +160,8 @@
      cellAttributes: { alignment: "right" },
      hideDefaultActions: true,
      typeAttributes: {
        shipmentAmount: { fieldName: "shipmentAmount" }
      }
                shipmentAmount: { fieldName: "shipmentAmount" },
            },
    },
    {
      label: "有效期内库存(盒)",
@@ -169,7 +169,7 @@
      cellAttributes: { alignment: "right" },
      wrapText: true,
      initialWidth: 160,
      hideDefaultActions: true
            hideDefaultActions: true,
    },
    {
      label: "有效期内库存(个)",
@@ -177,8 +177,8 @@
      cellAttributes: { alignment: "right" },
      wrapText: true,
      initialWidth: 160,
      hideDefaultActions: true
    }
            hideDefaultActions: true,
        },
  ];
  @track editColumns = [
    {
@@ -186,7 +186,7 @@
      fieldName: "Name__c",
      hideDefaultActions: true,
      wrapText: true,
      sortable: true
            sortable: true,
    },
    {
      label: "规格",
@@ -194,56 +194,56 @@
      initialWidth: 50,
      cellAttributes: { alignment: "right" },
      hideDefaultActions: true,
      wrapText: true
            wrapText: true,
    },
    {
      label: "CFDA状态",
      fieldName: "SFDA_Status__c",
      hideDefaultActions: true,
      initialWidth: 100,
      wrapText: true
            wrapText: true,
    },
    {
      label: "注册证编码号",
      fieldName: "approbation_No",
      hideDefaultActions: true,
      initialWidth: 170,
      wrapText: true
            wrapText: true,
    },
    {
      label: "注册证效期",
      fieldName: "expiration_Date",
      hideDefaultActions: true,
      initialWidth: 100,
      wrapText: true
            wrapText: true,
    },
    {
      label: "第3分类",
      fieldName: "Category3__c",
      hideDefaultActions: true,
      sortable: true,
      wrapText: true
            wrapText: true,
    },
    {
      label: "第4分类",
      fieldName: "Category4__c",
      hideDefaultActions: true,
      sortable: true,
      wrapText: true
            wrapText: true,
    },
    {
      label: "第5分类",
      fieldName: "Category5__c",
      hideDefaultActions: true,
      sortable: true,
      wrapText: true
            wrapText: true,
    },
    {
      label: "单位",
      fieldName: "Box_Piece__c",
      initialWidth: 50,
      hideDefaultActions: true,
      wrapText: true
            wrapText: true,
    },
    {
      label: "出货数量",
@@ -251,7 +251,7 @@
      initialWidth: 90,
      cellAttributes: { alignment: "right" },
      hideDefaultActions: true,
      wrapText: true
            wrapText: true,
    },
    {
      label: "出货单价(元)",
@@ -259,11 +259,11 @@
      type: "number",
      initialWidth: 100,
      typeAttributes: {
        minimumFractionDigits: 2
                minimumFractionDigits: 2,
      },
      hideDefaultActions: true,
      wrapText: true
    }
            wrapText: true,
        },
  ];
  @track editData = [];
@@ -278,19 +278,19 @@
      typeAttributes: {
        label: "选择",
        name: "Id2",
        size: 1
      }
                size: 1,
            },
    },
    {
      label: "医院名称",
      fieldName: "Name",
      hideDefaultActions: true,
      wrapText: true
            wrapText: true,
    },
    {
      label: "省份",
      fieldName: "stateMasterName",
      hideDefaultActions: true
            hideDefaultActions: true,
    }
  ];
@@ -304,31 +304,31 @@
  @track ConsumableOut_report = "";
  @track isMutualTransferGoods = false;
  @track Barcode = "";
  @track summonsForDirction = "";
  @track accountValue = "";
    @track summonsForDirction = '';
    @track accountValue = '';
  @track consumableorderdetails2RecordsColumns = [
    {
      label: "消耗品名称",
      fieldName: "ProdName",
      hideDefaultActions: true,
      wrapText: true
            wrapText: true,
    },
    {
      label: "批次号",
      fieldName: "orderdetails2SerialLotNo__c",
      hideDefaultActions: true
            hideDefaultActions: true,
    },
    {
      label: "管理编码",
      fieldName: "orderdetails2TracingCode__c",
      hideDefaultActions: true
            hideDefaultActions: true,
    },
    {
      label: "使用期限",
      fieldName: "orderdetails2Sterilization_limit__c",
      hideDefaultActions: true
    }
            hideDefaultActions: true,
        },
  ];
  @track consumableorderdetails2Records = [];
@@ -341,9 +341,9 @@
      type: "url",
      typeAttributes: {
        label: { fieldName: "Consumable_order_minor__c" },
        target: "_blank"
                target: "_blank",
      },
      wrapText: true
            wrapText: true,
    },
    {
      label: "消耗品明细2名称",
@@ -352,10 +352,10 @@
      initialWidth: 150,
      typeAttributes: {
        label: { fieldName: "orderdetails2Name" },
        target: "_blank"
                target: "_blank",
      },
      hideDefaultActions: true,
      wrapText: true
            wrapText: true,
    },
    {
      label: "单位",
@@ -369,13 +369,13 @@
      fieldName: "ProdName",
      initialWidth: 100,
      hideDefaultActions: true,
      wrapText: true
            wrapText: true,
    },
    {
      label: "发货日期",
      fieldName: "Deliver_date__c",
      hideDefaultActions: true,
      wrapText: true
            wrapText: true,
    },
    {
      label: "BarCode",
@@ -388,13 +388,13 @@
      label: "使用期限",
      fieldName: "Sterilization_limit__c",
      hideDefaultActions: true,
      wrapText: true
            wrapText: true,
    },
    {
      label: "出货数量",
      fieldName: "outboundCount",
            fieldName: 'outboundCount',
      hideDefaultActions: true,
      cellAttributes: { alignment: "right" }
            cellAttributes: { alignment: "right" },
    }
  ];
  @track salesData = [];
@@ -407,22 +407,22 @@
      type: "url",
      typeAttributes: {
        label: { fieldName: "Consumable_order_minor__c" },
        target: "_blank"
                target: "_blank",
      },
      wrapText: true
            wrapText: true,
    },
    {
      label: "消耗品明细2名称",
      fieldName: "orderdetails2Name",
      hideDefaultActions: true,
      initialWidth: 150,
      wrapText: true
            wrapText: true,
    },
    {
      label: "消耗品名称",
      fieldName: "ProdName",
      hideDefaultActions: true,
      wrapText: true
            wrapText: true,
    },
    {
      label: "单位",
@@ -442,14 +442,14 @@
      label: "使用期限",
      fieldName: "Sterilization_limit__c",
      hideDefaultActions: true,
      wrapText: true
            wrapText: true,
    },
    {
      label: "错误原因",
      fieldName: "ErrorReason",
      hideDefaultActions: true,
      wrapText: true
    }
            wrapText: true,
        },
  ];
  @track salesErrorData = [];
  @track salesAccountName = "";
@@ -503,7 +503,7 @@
  @track Category5 = "";
  @track category5Options = [];
  //发票id
  @track invoiceId = "";
    @track invoiceId = '';
  //二级经销商
  @track secondaryDistributor = "";
@@ -561,25 +561,25 @@
      fieldName: "url",
      type: "url",
      typeAttributes: { label: { fieldName: "Title" }, target: "_blank" },
      hideDefaultActions: true
            hideDefaultActions: true,
    },
    {
      label: "创建人",
      fieldName: "CreatedByName",
      hideDefaultActions: true
            hideDefaultActions: true,
    },
    {
      label: "",
      type: "tableCellIcon",
            label: '',
            type: 'tableCellIcon',
      typeAttributes: {
        iconName: "utility:delete",
                iconName: 'utility:delete',
        recordId: {
          fieldName: "Id"
                    fieldName: 'Id'
        }
      },
      initialWidth: 50,
      hideDefaultActions: true
    }
        },
  ];
  filesUploaded = [];
  fileContents;
@@ -590,8 +590,8 @@
  //分页start
  //@track sortBy = "";
  //@track sortDirection = "asc";
  defaultSortDirection = "asc";
  sortDirection = "asc";
    defaultSortDirection = 'asc';
    sortDirection = 'asc';
  sortedBy;
  @track pageSize = 10;
  error;
@@ -607,7 +607,7 @@
  @track recordStart = 0;
  @track recordEnd = 0;
  //end
  @track SearchDone = "";
    @track SearchDone = '';
  @track hideCheckboxColumn = false;
  stylesLoaded = false;
@@ -623,6 +623,7 @@
        });
    }
  }
  //InvoiceProNotLabel    RrturnProLabel  InvoicedLabel
  @wire(getObjectInfo, { objectApiName: OPPORTUNITY_OBJECT })
@@ -670,33 +671,26 @@
      pageSizeLWC: this.pageSize,
      pageTokenLWC: this.currentPageToken,
      arriveorderLWC: this.arriveorder
    })
      .then((r) => {
        }).then((r) => {
        r = JSON.parse(JSON.stringify(r));
        console.log("r = " + JSON.stringify(r));
        if (r.status == "Success") {
          //分页
          console.log(
            "r.entity.paginatedAccounts = " +
              JSON.stringify(r.entity.paginatedAccounts)
          );
                console.log('r.entity.paginatedAccounts = ' + JSON.stringify(r.entity.paginatedAccounts));
          this.nextPageToken = r.entity.paginatedAccounts.nextPageToken;
          this.totalRecords = r.entity.paginatedAccounts.totalRecords;
          this.recordStart = r.entity.paginatedAccounts.recordStart;
          this.recordEnd = r.entity.paginatedAccounts.recordEnd;
          this.totalPages = Math.ceil(
            r.entity.paginatedAccounts.totalRecords / this.pageSize
          );
          console.log("this.totalPages = " + this.totalPages);
                this.totalPages = Math.ceil(r.entity.paginatedAccounts.totalRecords / this.pageSize);
                console.log('this.totalPages = ' + this.totalPages);
          this.OECId =
            r.entity.HospitalInfo == null ? "" : r.entity.HospitalInfo;
                this.OECId = r.entity.HospitalInfo == null ? '' : r.entity.HospitalInfo;
          console.log("this.OECId = " + this.OECId);
          this.ConsumableOut_report = r.entity.ConsumableOut_report;
          console.log(
            "this.ConsumableOut_report = " + this.ConsumableOut_report
          );
                console.log("this.ConsumableOut_report = " + this.ConsumableOut_report);
          this.accountid = r.entity.accountid;
          this.consumableproductdetailsRecords =
            r.entity.consumableproductdetailsRecords;
@@ -705,32 +699,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);
          //查询附件
@@ -742,9 +718,7 @@
            object["value"] = key;
            this.category3Options.push(object);
          }
          console.log(
            "this.category3Options = " + JSON.stringify(this.category3Options)
          );
                console.log("this.category3Options = " + JSON.stringify(this.category3Options));
          //第4分类
          for (var key in r.entity.category4OptionMap) {
            let object = {};
@@ -777,55 +751,34 @@
                unitOptions.push(unitOption);
              }
              this.data[i]["unitOptions"] = unitOptions;
              this.data[i]["unitValue"] =
                this.data[i]["unitValue"] == null
                  ? unitOptions[0].value
                  : this.data[i]["unitValue"];
                        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"];
                            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;
              //this.data[i]["shipmentNumber"] = this.data[i].orderdetails1["Shipment_Count__c"] == 0 ? '' : this.data[i].orderdetails1["Shipment_Count__c"];
              //this.data[i]["shippingUnitPrice"] = this.data[i].orderdetails1["Delivery_List_RMB__c"] == 0 ? '' : this.data[i].orderdetails1["Delivery_List_RMB__c"];
              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]["shipmentNumber"] = this.data[i].orderdetails1["Shipment_Count__c"];
                        this.data[i]["shippingUnitPrice"] = this.data[i].orderdetails1["Delivery_List_RMB__c"];
              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";
                                this.data[i]["Id"] = this.data[i].Prod.Id + 'ishos';
                } else {
                  this.data[i]["Id"] = this.data[i].Prod.Id + "nothos";
                                this.data[i]["Id"] = this.data[i].Prod.Id + 'nothos';
                }
              }
              this.data[i]["recordId"] = this.data[i].Prod.Id;
@@ -834,56 +787,39 @@
              this.data[i]["Category3__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]["Box_Piece__c"] =
                this.data[i].orderdetails1.Box_Piece__c;
              this.data[i]["shipmentAmount"] =
                this.data[i].orderdetails1.Shipment_amount__c;
              this.data[i]["Shipment_amount__c"] =
                this.data[i].orderdetails1.Shipment_amount__c;
              this.data[i]["Shipment_Count__c"] =
                this.data[i].orderdetails1.Shipment_Count__c;
                        this.data[i]["Box_Piece__c"] = this.data[i].orderdetails1.Box_Piece__c;
                        this.data[i]["shipmentAmount"] = this.data[i].orderdetails1.Shipment_amount__c;
                        this.data[i]["Shipment_amount__c"] = this.data[i].orderdetails1.Shipment_amount__c;
                        this.data[i]["Shipment_Count__c"] = this.data[i].orderdetails1.Shipment_Count__c;
              if (this.data[i]["check"]) {
                        if (this.data[i]['check']) {
                this.selectedRows.push(this.data[i].Id);
              }
            }
            console.log("EditAble this.data = " + JSON.stringify(this.data));
                    console.log('EditAble this.data = ' + JSON.stringify(this.data))
          } else {
            for (var i in this.editData) {
              this.editData[i]["unitValue"] = this.editData[i]["unitValue"];
              this.editData[i]["InvoiceProNot_count__c"] =
                this.editData[i].orderdetails1.InvoiceProNot_count__c;
              this.editData[i]["RrturnPro_count__c"] =
                this.editData[i].orderdetails1.RrturnPro_count__c;
              this.editData[i]["Invoiced_Procount__c"] =
                this.editData[i].orderdetails1.Invoiced_Procount__c;
              this.editData[i]["shipmentNumber"] =
                this.editData[i].orderdetails1["Shipment_Count__c"];
              this.editData[i]["shippingUnitPrice"] =
                this.editData[i].orderdetails1["Delivery_List_RMB__c"];
                        this.editData[i]["InvoiceProNot_count__c"] = this.editData[i].orderdetails1.InvoiceProNot_count__c;
                        this.editData[i]["RrturnPro_count__c"] = this.editData[i].orderdetails1.RrturnPro_count__c;
                        this.editData[i]["Invoiced_Procount__c"] = this.editData[i].orderdetails1.Invoiced_Procount__c;
                        this.editData[i]["shipmentNumber"] = this.editData[i].orderdetails1["Shipment_Count__c"];
                        this.editData[i]["shippingUnitPrice"] = this.editData[i].orderdetails1["Delivery_List_RMB__c"];
              this.editData[i]["recordId"] = this.editData[i].Prod.Id;
              this.editData[i]["Id"] = this.editData[i].Prod.Id;
              this.editData[i]["Name__c"] = this.editData[i].Prod.Name__c;
              this.editData[i]["SFDA_Status__c"] =
                this.editData[i].Prod.SFDA_Status__c;
              this.editData[i]["Category3__c"] =
                this.editData[i].Prod.Category3__c;
              this.editData[i]["Category4__c"] =
                this.editData[i].Prod.Category4__c;
              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]["SFDA_Status__c"] = this.editData[i].Prod.SFDA_Status__c;
                        this.editData[i]["Category3__c"] = this.editData[i].Prod.Category3__c;
                        this.editData[i]["Category4__c"] = this.editData[i].Prod.Category4__c;
                        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]["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.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('end this.editData = ' + JSON.stringify(this.editData));
          }
          console.log("this.data = " + JSON.stringify(this.data));
@@ -905,26 +841,18 @@
          //disable
          debugger;
                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 == null
                ? ""
                : coc.Order_ForDealerText__c;
            this.ForDealerText =
              coc.Order_ForDealerText__c == null
                ? ""
                : coc.Order_ForDealerText__c;
            console.log("this.accountValue = " + this.accountValue);
                    this.accountValue = coc.Order_ForDealerText__c == null ? '' : coc.Order_ForDealerText__c;
                    this.ForDealerText = coc.Order_ForDealerText__c == null ? '' : coc.Order_ForDealerText__c;
                    console.log('this.accountValue = ' + this.accountValue);
            this.cocId = coc.Id;
            console.log("cocId = " + this.cocId);
                    console.log('cocId = ' + this.cocId);
            coc.SummonsStatus = coc.SummonsStatus_c__c;
            console.log(
              "this.cocLwc.Arrive_Order__c = " + this.cocLwc.Arrive_Order__c
            );
                    console.log('this.cocLwc.Arrive_Order__c = ' + this.cocLwc.Arrive_Order__c)
            if (this.cocLwc.Arrive_Order__c == null) {
              this.isBarcode = true;
            } else {
@@ -957,10 +885,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 (
@@ -1039,16 +964,16 @@
              type: "number",
              initialWidth: 105,
              typeAttributes: {
                minimumFractionDigits: 2
                            minimumFractionDigits: 2,
              },
              hideDefaultActions: true
                        hideDefaultActions: true,
            };
            let object2 = {
              label: this.RrturnProLabel,
              fieldName: "RrturnPro_count__c",
              cellAttributes: { alignment: "right" },
              initialWidth: 100,
              hideDefaultActions: true
                        hideDefaultActions: true,
            };
            let object3 = {
              label: this.InvoicedLabel,
@@ -1056,23 +981,18 @@
              type: "number",
              initialWidth: 100,
              typeAttributes: {
                minimumFractionDigits: 2
                            minimumFractionDigits: 2,
              },
              hideDefaultActions: true
                        hideDefaultActions: true,
            };
            this.editColumns.push(object1);
            this.editColumns.push(object2);
            this.editColumns.push(object3);
          } else {
            this.ForCustomerText = this.cocLwc.Order_ForCustomerText__c;
            console.log(
              "EditAble = true this.ForCustomerText = " + this.ForCustomerText
            );
                    console.log('EditAble = true this.ForCustomerText = ' + this.ForCustomerText);
            this.summonsForDirction = this.cocLwc.SummonsForDirction__c;
            console.log(
              "EditAble = true this.summonsForDirction = " +
                this.summonsForDirction
            );
                    console.log('EditAble = true this.summonsForDirction = ' + this.summonsForDirction);
            let value = this.summonsForDirction;
            switch (value) {
              case "直接销售给医院":
@@ -1081,7 +1001,7 @@
                this.secondaryDistributor = "";
                this.ForDealerText = "";
                this.accountValue = "";
                this.cocLwc["Order_ForDealerText__c"] = "";
                            this.cocLwc['Order_ForDealerText__c'] = '';
                this.isDisabledForDealerText = true;
                this.isDisabledSecondaryDistributor = true;
                break;
@@ -1124,8 +1044,8 @@
              label: "医院特价",
              initialWidth: 80,
              fieldName: "hospitalSpecialOffer",
              type: "boolean",
              hideDefaultActions: true
                        type: 'boolean',
                        hideDefaultActions: true,
            };
            this.columns.push(object1);
            this.editColumns.push(object1);
@@ -1151,39 +1071,25 @@
          );
          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 != "价格未定"
          ) {
                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 != "价格未定"
            )
          ) {
                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 = 'unitValue';
              }
              if (this.columns[i].label == "出货数量") {
                this.columns[i].type = "text";
                this.columns[i].fieldName = "shipmentNumber";
                        if (this.columns[i].label == '出货数量') {
                            this.columns[i].type = 'text';
                            this.columns[i].fieldName = 'shipmentNumber';
              }
            }
          }
@@ -1192,12 +1098,11 @@
          console.log("ESetid = " + this.ESetid);
        } else {
          console.log("r = " + JSON.stringify(r));
          this.showMyToast("初始化失败", r.msg, "Error");
                this.showMyToast('初始化失败', r.msg, 'Error');
        }
      })
      .catch((error) => {
        }).catch((error) => {
        console.log("error = " + JSON.stringify(error));
        this.showMyToast("错误", "初始化失败", "Error");
            this.showMyToast('错误', '初始化失败', 'Error');
      });
  }
@@ -1212,7 +1117,7 @@
        this.isDisabledForCustomerText = false;
        this.secondaryDistributor = "";
        this.ForDealerText = "";
        this.cocLwc["Order_ForDealerText__c"] = "";
                this.cocLwc['Order_ForDealerText__c'] = '';
        this.isDisabledForDealerText = true;
        this.isDisabledSecondaryDistributor = true;
        this.isMutualTransferGoods = false;
@@ -1291,17 +1196,17 @@
        this.Category3 = value;
        //调用后台显示第四五分类
        this.showAllCate();
        if (this.Category3 == "") {
          this.Category4 = "";
          this.Category5 = "";
                if (this.Category3 == '') {
                    this.Category4 = '';
                    this.Category5 = '';
        }
        break;
      case "Category4":
        this.Category4 = value;
        //调用后台显示第五分类
        this.showCate();
        if (this.Category4 == "") {
          this.Category5 = "";
                if (this.Category4 == '') {
                    this.Category5 = '';
        }
        break;
      case "Category5":
@@ -1320,11 +1225,10 @@
  }
  showAllCate() {
    console.log("showAllCate");
        console.log('showAllCate')
    categoryAllload({
      category3Lwc: this.Category3
    })
      .then((r) => {
        }).then((r) => {
        r = JSON.parse(JSON.stringify(r));
        console.log("r = " + JSON.stringify(r));
        if (r.status == "Success") {
@@ -1347,21 +1251,19 @@
          }
        } else {
          console.log("r = " + JSON.stringify(r));
          this.showMyToast("4/5分类查询失败", r.msg, "Error");
                this.showMyToast('4/5分类查询失败', r.msg, 'Error');
        }
      })
      .catch((error) => {
        }).catch((error) => {
        console.log("error" + JSON.stringify(error));
      });
  }
  showCate() {
    console.log("showAllCate");
        console.log('showAllCate')
    categoryload({
      category3Lwc: this.Category3,
      category4Lwc: this.Category4
    })
      .then((r) => {
        }).then((r) => {
        r = JSON.parse(JSON.stringify(r));
        console.log("r = " + JSON.stringify(r));
        if (r.status == "Success") {
@@ -1384,50 +1286,44 @@
          }
        } else {
          console.log("r = " + JSON.stringify(r));
          this.showMyToast("Error", r.msg, "Error");
                this.showMyToast('Error', r.msg, 'Error');
        }
      })
      .catch((error) => {
        }).catch((error) => {
        console.log("error" + JSON.stringify(error));
      });
  }
  invoiceChange(event) {
    this.invoiceId = event.target.value;
    console.log("this.invoiceId = " + this.invoiceId);
        console.log('this.invoiceId = ' + this.invoiceId);
  }
  showMyToast(title, message, variant) {
    this.isShowSpinner = false;
    this.showLoadingSpinner = false;
    this.isEditShowSpinner = false;
    console.log("show custom message");
    var iconName = "";
    var content = "";
    if (variant.toLowerCase() == "success") {
      iconName = "utility:check";
        console.log('show custom message');
        var iconName = '';
        var content = '';
        if (variant.toLowerCase() == 'success') {
            iconName = 'utility:check';
    } else {
      iconName = "utility:error";
            iconName = 'utility:error';
    }
    if (message != "") {
      content =
        "<h2><strong>" + title + "<strong/></h2><h5>" + message + "</h5>";
        if (message != '') {
            content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
    } else {
      content = "<h2><strong>" + title + "<strong/></h2>";
            content = '<h2><strong>' + title + '<strong/></h2>';
    }
    this.template
      .querySelector("c-common-toast")
      .showToast(variant, content, iconName, 10000);
        this.template.querySelector('c-common-toast').showToast(variant, content, iconName, 10000);
  }
  searchProductJs() {
    this.isEditShowSpinner = true;
    //this.showTable = false;
    //查询有哪些选择了的然后check
    const selectedRows = this.template
      .querySelector("c-lex-custom-lightning-datatable")
      .getSelectedRows();
    console.log("selectedRows = " + selectedRows);
        const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
        console.log('selectedRows = ' + selectedRows);
    for (var i in this.data) {
      this.data[i]["check"] = false;
    }
@@ -1473,19 +1369,15 @@
      r = JSON.parse(JSON.stringify(r));
      console.log("r = " + JSON.stringify(r));
      if (r.status == "Success") {
        //分页
        console.log(
          "r.entity.paginatedAccounts = " +
            JSON.stringify(r.entity.paginatedAccounts)
        );
                console.log('r.entity.paginatedAccounts = ' + JSON.stringify(r.entity.paginatedAccounts));
        this.nextPageToken = r.entity.paginatedAccounts.nextPageToken;
        this.totalRecords = r.entity.paginatedAccounts.totalRecords;
        this.recordStart = r.entity.paginatedAccounts.recordStart;
        this.recordEnd = r.entity.paginatedAccounts.recordEnd;
        this.totalPages = Math.ceil(
          r.entity.paginatedAccounts.totalRecords / this.pageSize
        );
        console.log("this.totalPages = " + this.totalPages);
                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);
@@ -1503,27 +1395,12 @@
            unitOptions.push(unitOption);
          }
          tempData[i]["unitOptions"] = unitOptions;
          tempData[i]["unitValue"] =
            tempData[i]["unitValue"] == null
              ? unitOptions[0].value
              : tempData[i]["unitValue"];
                    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"];
                        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 {
            tempData[i]["InvoiceProNot_count__c"] =
              tempData[i].orderdetails1.InvoiceProNot_count__c;
@@ -1532,22 +1409,17 @@
            tempData[i]["Invoiced_Procount__c"] =
              tempData[i].orderdetails1.Invoiced_Procount__c;
          }
          tempData[i]["shipmentNumber"] =
            tempData[i].orderdetails1["Shipment_Count__c"];
          tempData[i]["shippingUnitPrice"] =
            tempData[i].orderdetails1["Delivery_List_RMB__c"];
                    tempData[i]["shipmentNumber"] = tempData[i].orderdetails1["Shipment_Count__c"];
                    tempData[i]["shippingUnitPrice"] = tempData[i].orderdetails1["Delivery_List_RMB__c"];
          tempData[i]["Id"] = tempData[i].Prod.Id;
          console.log(
            'tempData[i]["hospitalSpecialOffer"] = ' +
              tempData[i]["hospitalSpecialOffer"]
          );
                    console.log('tempData[i]["hospitalSpecialOffer"] = ' + tempData[i]["hospitalSpecialOffer"])
          if (this.hasHosPro) {
            if (tempData[i]["hospitalSpecialOffer"]) {
              tempData[i]["Id"] = tempData[i].Prod.Id + "ishos";
                            tempData[i]["Id"] = tempData[i].Prod.Id + 'ishos';
            } else {
              tempData[i]["Id"] = tempData[i].Prod.Id + "nothos";
                            tempData[i]["Id"] = tempData[i].Prod.Id + 'nothos';
            }
          }
@@ -1558,12 +1430,9 @@
          tempData[i]["Category4__c"] = tempData[i].Prod.Category4__c;
          tempData[i]["Category5__c"] = tempData[i].Prod.Category5__c;
          tempData[i]["Box_Piece__c"] = tempData[i].orderdetails1.Box_Piece__c;
          tempData[i]["shipmentAmount"] =
            tempData[i].orderdetails1.Shipment_amount__c;
          tempData[i]["Shipment_amount__c"] =
            tempData[i].orderdetails1.Shipment_amount__c;
          tempData[i]["Shipment_Count__c"] =
            tempData[i].orderdetails1.Shipment_Count__c;
                    tempData[i]["shipmentAmount"] = tempData[i].orderdetails1.Shipment_amount__c;
                    tempData[i]["Shipment_amount__c"] = tempData[i].orderdetails1.Shipment_amount__c;
                    tempData[i]["Shipment_Count__c"] = tempData[i].orderdetails1.Shipment_Count__c;
          if (tempData[i]["shippingUnitPrice"] && tempData[i]["shipmentNumber"])
            tempData[i]["shipmentAmount"] = this.amend(
@@ -1572,21 +1441,22 @@
              "*"
            );
          if (tempData[i]["check"]) {
                    if (tempData[i]['check']) {
            this.selectedRows.push(tempData[i].Id);
          }
        }
        this.data = tempData;
        //如果hasHosPro = true 医院特价
        console.log("this.hasHosPro = " + this.hasHosPro);
                console.log('this.hasHosPro = ' + this.hasHosPro);
        if (this.hasHosPro) {
          let object1 = {
            label: "医院特价",
            fieldName: "hospitalSpecialOffer",
            type: "boolean",
                        type: 'boolean',
            initialWidth: 80,
            hideDefaultActions: true
                        hideDefaultActions: true,
          };
          this.columns.push(object1);
          this.editColumns.push(object1);
@@ -1595,14 +1465,12 @@
        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)
        );
                console.log(" this.selectedRows = " + JSON.stringify(this.selectedRows));
        //this.showTable = true;
        this.isEditShowSpinner = false;
      } else {
        console.log("r = " + JSON.stringify(r));
        this.showMyToast("查询失败", r.msg, "Error");
                this.showMyToast('查询失败', r.msg, 'Error');
      }
    });
  }
@@ -1610,7 +1478,7 @@
  searchHospitalNameModal() {
    console.log("searchHospitalNameModal");
    hospitalInit({
      ctype: this.agencyProType
            ctype: this.agencyProType,
    }).then((r) => {
      r = JSON.parse(JSON.stringify(r));
      if (r.status == "Success") {
@@ -1629,7 +1497,7 @@
    console.log("this.searchHospitalName = " + this.searchHospitalName);
    serContact({
      searchName: this.searchHospitalName,
      ctype: this.agencyProType
            ctype: this.agencyProType,
    }).then((r) => {
      r = JSON.parse(JSON.stringify(r));
      if (r.status == "Success") {
@@ -1711,33 +1579,22 @@
      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
        );
        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"] != "") {
                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.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));
                console.log('this.selectedRows = ' + JSON.stringify(this.selectedRows));
      }
    }
    this.data = [...this.data];
@@ -1839,10 +1696,10 @@
  getSelectedRows(event) {
    let selectedRowsEvent = event.detail.selectedRows;
    console.log("selectedRowsEvent = " + JSON.stringify(selectedRowsEvent));
        console.log('selectedRowsEvent = ' + JSON.stringify(selectedRowsEvent))
    this.selectedRows = [];
    for (var i in selectedRowsEvent) {
      this.selectedRows.push(selectedRowsEvent[i].Id);
            this.selectedRows.push(selectedRowsEvent[i].Id)
    }
    // for (var i in this.data) {
    //     for (var j in selectedRowsEvent) {
@@ -1893,10 +1750,8 @@
    this.isShowSpinner = true;
    //查询有哪些选择了的然后check
    const selectedRows = this.template
      .querySelector("c-lex-custom-lightning-datatable")
      .getSelectedRows();
    console.log("selectedRows = " + selectedRows);
        const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
        console.log('selectedRows = ' + selectedRows);
    for (var i in this.data) {
      this.data[i]["check"] = false;
    }
@@ -1944,11 +1799,10 @@
      consumableproductdetailsRecordsLwc: this.consumableproductdetailsRecords,
      agencyProTypeLwc: this.agencyProType,
      userWorkLocationLwc: this.userWorkLocation
    })
      .then((r) => {
        }).then((r) => {
        r = JSON.parse(JSON.stringify(r));
        console.log("r = " + JSON.stringify(r));
        debugger;
            debugger
        if (r.status == "Success") {
          // let url = "/lexsummonscreat?ESetid=" + r.entity.ESetId;
          // this[NavigationMixin.Navigate]({
@@ -1960,10 +1814,9 @@
          window.location.href = "/s/lexsummonscreat?ESetid=" + r.entity.ESetId;
        } else {
          console.log("r.msg = " + r.msg);
          this.showMyToast("保存失败", r.msg, "Error");
                this.showMyToast('保存失败', r.msg, 'Error');
        }
      })
      .catch((error) => {
        }).catch((error) => {
        console.log("error = " + JSON.stringify(error));
      });
  }
@@ -1974,7 +1827,7 @@
    console.log("this.ESetId = " + this.ESetid);
    PraseToPDF({
      cocLwc: this.cocLwc,
      ESetId: this.ESetid
            ESetId: this.ESetid,
    }).then((r) => {
      r = JSON.parse(JSON.stringify(r));
      console.log("r = " + JSON.stringify(r));
@@ -1982,7 +1835,7 @@
        window.open("/customer/summonsPDF?ESetid=" + r.entity.ESetId);
      } else {
        console.log("r.msg = " + r.msg);
        this.showMyToast("打印失败", r.msg, "Error");
                this.showMyToast('打印失败', r.msg, 'Error');
      }
    });
  }
@@ -1993,17 +1846,10 @@
    var reportId = this.ESetid;
    reportId = reportId.substring(0, 15);
    console.log("reportId = " + reportId);
    let reportFilters =
      '[{"operator":"equals","value":"' +
      reportId +
      '","column":"FK_CUSTENT_ID"}]';
        let reportFilters = '[{"operator":"equals","value":"' + reportId + '","column":"FK_CUSTENT_ID"}]';
    let reportUrl = this.label.ConsumableOutboundReportId;
    console.log("reportUrl = " + reportUrl);
    let url =
      "/s/report/" +
      reportUrl +
      "?reportFilters=" +
      encodeURIComponent(reportFilters);
        let url = "/s/report/" + reportUrl + "?reportFilters=" + encodeURIComponent(reportFilters);
    console.log("url = " + url);
    window.open(url);
    // this[NavigationMixin.Navigate]({
@@ -2039,12 +1885,10 @@
    const lookupElement = event.target;
    console.log("event.detail = " + JSON.stringify(event.detail));
    apexSearch({
      searchTerm: event.detail.searchTerm
    })
      .then((results) => {
            searchTerm: event.detail.searchTerm,
        }).then((results) => {
        lookupElement.setSearchResults(results);
      })
      .catch((error) => {
        }).catch((error) => {
        console.log("error" + JSON.stringify(error));
      });
  }
@@ -2070,7 +1914,7 @@
    if (this.filesUploaded.length > 0) {
      this.file = this.filesUploaded[0];
      if (this.file.size > this.MAX_FILE_SIZE) {
        this.showMyToast("保存失败", "文件过大", "Error");
                this.showMyToast('保存失败', '文件过大', 'Error');
        return;
      }
      this.showPopSpinner = true;
@@ -2095,20 +1939,18 @@
    saveFile({
      recordId: this.ESetid,
      fileName: this.fileName,
      base64Data: encodeURIComponent(this.fileContents)
    })
      .then((r) => {
            base64Data: encodeURIComponent(this.fileContents),
        }).then((r) => {
        this.showPopSpinner = false;
        r = JSON.parse(JSON.stringify(r));
        console.log("r = " + JSON.stringify(r));
        this.closePop();
        this.showMyToast("上传成功", "", "Success");
            this.showMyToast('上传成功', '', 'Success');
        this.getFiles();
      })
      .catch((error) => {
        }).catch((error) => {
        this.showPopSpinner = false;
        console.log("error = " + error.message);
        this.showMyToast("失败", "上传失败", "Error");
            this.showMyToast('失败', '上传失败', 'Error');
      });
  }
@@ -2116,9 +1958,8 @@
    console.log("getFiles");
    this.showLoadingSpinner = true;
    getFiles({
      recordId: this.ESetid
    })
      .then((r) => {
            recordId: this.ESetid,
        }).then((r) => {
        r = JSON.parse(JSON.stringify(r));
        console.log("r = " + JSON.stringify(r));
        this.fileData = r.entity.cvList;
@@ -2128,18 +1969,14 @@
          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";
                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) => {
        }).catch((error) => {
        console.log("error = " + error.message);
        this.showMyToast("失败", "获取附件失败", "Error");
            this.showMyToast('失败', '获取附件失败', 'Error');
      });
  }
@@ -2147,10 +1984,8 @@
    this.isShowSpinner = true;
    //查询有哪些选择了的然后check
    const selectedRows = this.template
      .querySelector("c-lex-custom-lightning-datatable")
      .getSelectedRows();
    console.log("selectedRows = " + selectedRows);
        const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
        console.log('selectedRows = ' + selectedRows);
    for (var i in this.data) {
      this.data[i]["check"] = false;
    }
@@ -2179,36 +2014,32 @@
    GoodsDelivery({
      cocLwc: this.cocLwc,
      ESetId: this.ESetid,
      pageRecordsLwcLwc: cloneData
    })
      .then((r) => {
            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.isSales = this.cocLwc["Summons_Order_type__c"] == "销售" ? true : false;
          this.GoodsDeliveryInit();
        } else {
          console.log("r.msg = " + r.msg);
          this.showMyToast("错误", r.msg, "Error");
                this.showMyToast('错误', r.msg, 'Error');
        }
        this.isShippingSales = true;
      })
      .catch((error) => {
        }).catch((error) => {
        console.log("error = " + error.message);
        this.showMyToast("失败", "跳转失败", "Error");
            this.showMyToast('失败', '跳转失败', 'Error');
      });
  }
  GoodsDeliveryInit() {
    console.log("GoodsDeliveryInit");
    GoodsDeliveryInit({
      ESetId: this.ESetid
    })
      .then((r) => {
            ESetId: this.ESetid,
        }).then((r) => {
        r = JSON.parse(JSON.stringify(r));
        console.log("r = " + JSON.stringify(r));
        if (r.status == "Success") {
@@ -2217,100 +2048,55 @@
          this.salesUserWorkLocation = r.entity.userWorkLocation;
          this.salesAccountid = r.entity.accountid;
          this.salesOrderdetails = r.entity.orderdetails;
          console.log(
            "this.salesOrderdetails = " + JSON.stringify(this.salesOrderdetails)
          );
                console.log('this.salesOrderdetails = ' + JSON.stringify(this.salesOrderdetails))
          this.salesData = r.entity.consumableorderdetailsRecords;
          console.log("this.salesData = " + JSON.stringify(this.salesData));
                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]["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;
                    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;
                            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;
                }
              }
            }
          }
          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.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");
                this.showMyToast('初始化失败', r.msg, 'Error');
        }
      })
      .catch((error) => {
        }).catch((error) => {
        console.log("error = " + error.message);
        this.showMyToast("错误", "初始化失败", "Error");
            this.showMyToast('错误', '初始化失败', 'Error');
      });
  }
@@ -2324,9 +2110,8 @@
      userWorkLocation: this.salesUserWorkLocation,
      accountid: this.salesAccountid,
      orderdetails: this.salesOrderdetails,
      orderpieceorboxMap: this.salesOrderpieceorboxMap
    })
      .then((r) => {
            orderpieceorboxMap: this.salesOrderpieceorboxMap,
        }).then((r) => {
        r = JSON.parse(JSON.stringify(r));
        console.log("r = " + JSON.stringify(r));
        if (r.status == "Success") {
@@ -2334,78 +2119,36 @@
          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;
                    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;
          }
          console.log("this.salesData = " + JSON.stringify(this.salesData));
                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]["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;
                    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;
                            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;
                }
              }
            }
@@ -2424,10 +2167,9 @@
          this.isShowSpinner = false;
        } else {
          console.log("r.msg = " + r.msg);
          this.showMyToast("获取失败", r.msg, "Error");
                this.showMyToast('获取失败', r.msg, 'Error');
        }
      })
      .catch((error) => {
        }).catch((error) => {
        console.log("error = " + JSON.stringify(error.message));
      });
  }
@@ -2436,10 +2178,10 @@
    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;
                this.salesData[i]['outboundCount'] = outboundDetail.data.count
      }
    }
    console.log("this.salesData = " + JSON.stringify(this.salesData));
        console.log('this.salesData = ' + JSON.stringify(this.salesData))
  }
  SaveP() {
@@ -2466,9 +2208,8 @@
      consumableorderdetailsRecordsLwc: JSON.stringify(cloneSalesData),
      orderdetailsLwc: this.salesOrderdetails,
      orderpriceMapLwc: this.salesOrderpriceMap,
      orderagencypriceMapLwc: this.salesOrderagencypriceMap
    })
      .then((r) => {
            orderagencypriceMapLwc: this.salesOrderagencypriceMap,
        }).then((r) => {
        r = JSON.parse(JSON.stringify(r));
        console.log("r = " + JSON.stringify(r));
        if (r.status == "Success") {
@@ -2477,17 +2218,16 @@
          this[NavigationMixin.Navigate]({
            type: "standard__webPage",
            attributes: {
              url: "/lexsaleanddelivery"
            }
                        url: "/lexsaleanddelivery",
                    },
          });
        } else {
          console.log("r.msg = " + r.msg);
          this.showMyToast("销售失败", r.msg, "Error");
                this.showMyToast('销售失败', r.msg, 'Error');
        }
      })
      .catch((error) => {
        }).catch((error) => {
        console.log("error = " + JSON.stringify(error.message));
        this.showMyToast("错误", "销售失败", "Error");
            this.showMyToast('错误', '销售失败', 'Error');
      });
  }
@@ -2514,9 +2254,8 @@
      consumableorderdetailsRecordsLwc: JSON.stringify(cloneSalesData),
      orderdetailsLwc: this.salesOrderdetails,
      orderpriceMapLwc: this.salesOrderpriceMap,
      orderagencypriceMapLwc: this.salesOrderagencypriceMap
    })
      .then((r) => {
            orderagencypriceMapLwc: this.salesOrderagencypriceMap,
        }).then((r) => {
        r = JSON.parse(JSON.stringify(r));
        console.log("r = " + JSON.stringify(r));
        if (r.status == "Success") {
@@ -2525,34 +2264,27 @@
          this[NavigationMixin.Navigate]({
            type: "standard__webPage",
            attributes: {
              url: "/lexsaleanddelivery"
            }
                        url: "/lexsaleanddelivery",
                    },
          });
        } else {
          console.log("r.msg = " + r.msg);
          this.showMyToast("出货失败", r.msg, "Error");
                this.showMyToast('出货失败', r.msg, 'Error');
        }
      })
      .catch((error) => {
        }).catch((error) => {
        console.log("error = " + JSON.stringify(error.message));
        this.showMyToast("错误", "出货失败", "Error");
            this.showMyToast('错误', '出货失败', 'Error');
      });
  }
  //发票
  openToInvoiceJs() {
    let url = "";
    console.log("this.invoiceId = " + this.invoiceId);
    if (this.invoiceId.length > 0 && this.invoiceId != "000000000000000") {
      url =
        "/s/lexconinvoiceview?deliveryId=" +
        this.ESetid +
        "&invoiceId=" +
        this.invoiceId +
        "&KeyWords=Redirect";
        let url = '';
        console.log('this.invoiceId = ' + this.invoiceId);
        if (this.invoiceId.length > 0 && this.invoiceId != '000000000000000') {
            url = "/s/lexconinvoiceview?deliveryId=" + this.ESetid + "&invoiceId=" + this.invoiceId + "&KeyWords=Redirect";
    } else {
      url =
        "/s/lexconinvoiceview?deliveryId=" + this.ESetid + "&KeyWords=Redirect";
            url = "/s/lexconinvoiceview?deliveryId=" + this.ESetid + "&KeyWords=Redirect";
    }
    window.open(url);
    // this[NavigationMixin.Navigate]({
@@ -2568,9 +2300,8 @@
  DeleteConsumable() {
    this.isShowSpinner = true;
    DelConsumable({
      ESetId: this.ESetid
    })
      .then((r) => {
            ESetId: this.ESetid,
        }).then((r) => {
        r = JSON.parse(JSON.stringify(r));
        console.log("r = " + JSON.stringify(r));
        if (r.status == "Success") {
@@ -2578,42 +2309,40 @@
          this[NavigationMixin.Navigate]({
            type: "standard__webPage",
            attributes: {
              url: url
            }
                        url: url,
                    },
          });
        } else {
          console.log("r.msg = " + r.msg);
          this.showMyToast("删除失败", r.msg, "Error");
                this.showMyToast('删除失败', r.msg, 'Error');
        }
      })
      .catch((error) => {
        }).catch((error) => {
        console.log("error = " + error.message);
        this.showMyToast("错误", "删除失败", "Error");
            this.showMyToast('错误', '删除失败', 'Error');
      });
  }
  handleLoad() {
    console.log("handleLoad");
        console.log('handleLoad')
    try {
      const style = document.createElement("style");
      style.innerText = ".hehe-layoutItem .slds-button__icon {display: none;}";
      this.template.querySelector(".hideHelpText").appendChild(style);
            const style = document.createElement('style');
            style.innerText = '.hehe-layoutItem .slds-button__icon {display: none;}';
            this.template.querySelector('.hideHelpText').appendChild(style);
    } catch (error) {
      console.log(error);
    }
  }
  handleLoad2() {
    console.log("handleLoad2");
        console.log('handleLoad2')
    try {
      const style = document.createElement("style");
      style.innerText = ".hehe-layoutItem .slds-button__icon {display: none;}";
      this.template.querySelector(".hideHelpText").appendChild(style);
            const style = document.createElement('style');
            style.innerText = '.hehe-layoutItem .slds-button__icon {display: none;}';
            this.template.querySelector('.hideHelpText').appendChild(style);
      const style2 = document.createElement("style");
      style2.innerText =
        ".hehe-layoutItem  .slds-form-element__label {padding : 0px}";
      this.template.querySelector(".hideHelpText").appendChild(style2);
            const style2 = document.createElement('style');
            style2.innerText = '.hehe-layoutItem  .slds-form-element__label {padding : 0px}';
            this.template.querySelector('.hideHelpText').appendChild(style2);
    } catch (error) {
      console.log(error);
    }
@@ -2624,8 +2353,8 @@
    this[NavigationMixin.Navigate]({
      type: "standard__webPage",
      attributes: {
        url: url
      }
                url: url,
            },
    });
  }
@@ -2639,17 +2368,13 @@
    if (event.target.files.length > 0) {
      this.filesUploaded = event.target.files;
      this.fileName = event.target.files[0].name;
      console.log("this.fileName:" + this.fileName);
            console.log('this.fileName:' + this.fileName);
    }
  }
  //是否显示附件移除
  get attDelBtn() {
    if (
      this.fileName != "" &&
      this.fileName != null &&
      this.fileName != "请选择一个文件上传"
    ) {
        if (this.fileName != '' && this.fileName != null && this.fileName != '请选择一个文件上传') {
      return true;
    } else {
      return false;
@@ -2666,14 +2391,14 @@
  //移除附件
  removeAtt() {
    this.filesUploaded = [];
    this.fileName = "";
        this.fileName = '';
  }
  ClearJs() {
    this.consumableName = "";
    this.Category3 = "";
    this.Category4 = "";
    this.Category5 = "";
        this.consumableName = '';
        this.Category3 = '';
        this.Category4 = '';
        this.Category5 = '';
    this.searchProductJs();
  }
@@ -2694,20 +2419,19 @@
  }
  onHandleSort(event) {
    //将已经选好了的放到前面,不进行排序
    if (this.EditAble) {
      const { fieldName: sortedBy, sortDirection } = event.detail;
      const cloneData = [...this.data];
      cloneData.sort(this.sortBy(sortedBy, sortDirection === "asc" ? 1 : -1));
            cloneData.sort(this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1));
      let index = 0;
      let selectedRows = this.template
        .querySelector("c-lex-custom-lightning-datatable")
        .getSelectedRows();
            let selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
      let selectedRowsIds = [];
      for (var i in selectedRows) {
        selectedRowsIds.push(selectedRows[i].Id);
      }
      console.log("selectedRowsIds = " + JSON.stringify(selectedRowsIds));
            console.log('selectedRowsIds = ' + JSON.stringify(selectedRowsIds));
      for (var i = 0; i < cloneData.length; i++) {
        if (selectedRowsIds.indexOf(cloneData[i].Id) != -1) {
          if (i != 0) {
@@ -2724,7 +2448,7 @@
    } else {
      const { fieldName: sortedBy, sortDirection } = event.detail;
      const cloneData = [...this.editData];
      cloneData.sort(this.sortBy(sortedBy, sortDirection === "asc" ? 1 : -1));
            cloneData.sort(this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1));
      this.editData = cloneData;
      this.sortDirection = sortDirection;
      this.sortedBy = sortedBy;
@@ -2732,14 +2456,12 @@
  }
  handlePrevious() {
    this.currentPageToken =
      Number(this.currentPageToken) - Number(this.pageSize);
        this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize);
    this.searchProductJs();
  }
  handleNext() {
    this.currentPageToken =
      Number(this.currentPageToken) + Number(this.pageSize);
        this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize);
    this.searchProductJs();
  }
  handleFirst() {
@@ -2748,8 +2470,7 @@
  }
  handleLast() {
    this.currentPageToken =
      this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
        this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
    this.searchProductJs();
  }
@@ -2760,15 +2481,15 @@
    this.searchProductJs();
  }
  editHandlePrevious() {
    this.currentPageToken =
      Number(this.currentPageToken) - Number(this.pageSize);
        this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize);
    this.searchEditProductJs();
  }
  editHandleNext() {
    this.currentPageToken =
      Number(this.currentPageToken) + Number(this.pageSize);
        this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize);
    this.searchEditProductJs();
  }
  editHandleFirst() {
@@ -2777,8 +2498,7 @@
  }
  editHandleLast() {
    this.currentPageToken =
      this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
        this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
    this.searchEditProductJs();
  }
@@ -2797,70 +2517,50 @@
      statusEdit: this.statusEdit,
      pageSizeLWC: this.pageSize,
      pageTokenLWC: this.currentPageToken
    })
      .then((r) => {
        }).then((r) => {
        r = JSON.parse(JSON.stringify(r));
        console.log("r = " + JSON.stringify(r));
        if (r.status == "Success") {
          //分页
          console.log(
            "r.entity.paginatedAccounts = " +
              JSON.stringify(r.entity.paginatedAccounts)
          );
                console.log('r.entity.paginatedAccounts = ' + JSON.stringify(r.entity.paginatedAccounts));
          this.nextPageToken = r.entity.paginatedAccounts.nextPageToken;
          this.totalRecords = r.entity.paginatedAccounts.totalRecords;
          this.recordStart = r.entity.paginatedAccounts.recordStart;
          this.recordEnd = r.entity.paginatedAccounts.recordEnd;
          this.totalPages = Math.ceil(
            r.entity.paginatedAccounts.totalRecords / this.pageSize
          );
          console.log("this.totalPages = " + this.totalPages);
                this.totalPages = Math.ceil(r.entity.paginatedAccounts.totalRecords / this.pageSize);
                console.log('this.totalPages = ' + this.totalPages);
          this.editData = r.entity.pageRecords;
          console.log("this.data start = " + JSON.stringify(this.data));
          for (var i in this.editData) {
            this.editData[i]["unitValue"] = this.editData[i]["unitValue"];
            this.editData[i]["InvoiceProNot_count__c"] =
              this.editData[i].orderdetails1.InvoiceProNot_count__c;
            this.editData[i]["RrturnPro_count__c"] =
              this.editData[i].orderdetails1.RrturnPro_count__c;
            this.editData[i]["Invoiced_Procount__c"] =
              this.editData[i].orderdetails1.Invoiced_Procount__c;
            this.editData[i]["shipmentNumber"] =
              this.editData[i].orderdetails1["Shipment_Count__c"];
            this.editData[i]["shippingUnitPrice"] =
              this.editData[i].orderdetails1["Delivery_List_RMB__c"];
                    this.editData[i]["InvoiceProNot_count__c"] = this.editData[i].orderdetails1.InvoiceProNot_count__c;
                    this.editData[i]["RrturnPro_count__c"] = this.editData[i].orderdetails1.RrturnPro_count__c;
                    this.editData[i]["Invoiced_Procount__c"] = this.editData[i].orderdetails1.Invoiced_Procount__c;
                    this.editData[i]["shipmentNumber"] = this.editData[i].orderdetails1["Shipment_Count__c"];
                    this.editData[i]["shippingUnitPrice"] = this.editData[i].orderdetails1["Delivery_List_RMB__c"];
            this.editData[i]["recordId"] = this.editData[i].Prod.Id;
            this.editData[i]["Id"] = this.editData[i].Prod.Id;
            this.editData[i]["Name__c"] = this.editData[i].Prod.Name__c;
            this.editData[i]["SFDA_Status__c"] =
              this.editData[i].Prod.SFDA_Status__c;
            this.editData[i]["Category3__c"] =
              this.editData[i].Prod.Category3__c;
            this.editData[i]["Category4__c"] =
              this.editData[i].Prod.Category4__c;
            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]["SFDA_Status__c"] = this.editData[i].Prod.SFDA_Status__c;
                    this.editData[i]["Category3__c"] = this.editData[i].Prod.Category3__c;
                    this.editData[i]["Category4__c"] = this.editData[i].Prod.Category4__c;
                    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]["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.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.showMyToast("搜索失败", r.msg, "Error");
                this.showMyToast('搜索失败', r.msg, 'Error');
        }
      })
      .catch((error) => {
        this.showMyToast("错误", "搜索失败", "Error");
        }).catch((error) => {
            this.showMyToast('错误', '搜索失败', 'Error');
      });
  }
@@ -2877,21 +2577,19 @@
    this.isShowSpinner = true;
    //var recordId = event.detail.data.recordId;
    var recordId = event.target.getAttribute("data-fileid");
    console.log("attid:" + recordId);
        console.log('attid:' + recordId);
    deleteAtt({
      contentVersionId: recordId
    })
      .then((r) => {
        }).then(r => {
        r = JSON.parse(JSON.stringify(r));
        if (r.status == "Success") {
          this.showMyToast("删除成功", "", "Success");
                this.showMyToast('删除成功', '', 'Success');
          this.getFiles();
        } else {
          this.showMyToast("删除失败", r.msg, "Error");
                this.showMyToast('删除失败', r.msg, 'Error');
        }
        }).catch(error => {
            this.showMyToast('错误', error.message, 'Error');
      })
      .catch((error) => {
        this.showMyToast("错误", error.message, "Error");
      });
  }
}