buli
2023-07-14 5b5c1e16deaa3a9d6d0ed1ffca390655ed103df7
force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
@@ -1,4 +1,4 @@
import { LightningElement, wire, api, track } from "lwc"; save
import { LightningElement, wire, api, track } from "lwc";
import init from "@salesforce/apex/LexSummonsCreatController.init";
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import searchConsumableorderdetails from "@salesforce/apex/LexSummonsCreatController.searchConsumableorderdetails";
@@ -19,7 +19,7 @@
import { getObjectInfo } from "lightning/uiObjectInfoApi";
import hospitalInit from "@salesforce/apex/lexSearchAgencyHospitalController.init";
import serContact from "@salesforce/apex/lexSearchAgencyHospitalController.serContact";
import deleteAtt from '@salesforce/apex/LexConsumableController.deleteAtt';
import deleteAtt from '@salesforce/apex/LexSummonsCreatController.deleteAtt';
import { NavigationMixin } from "lightning/navigation";
//table css 
import { loadStyle } from "lightning/platformResourceLoader";
@@ -87,7 +87,7 @@
            label: "注册证编码号",
            fieldName: "approbation_No",
            wrapText: true,
            initialWidth: 115,
            initialWidth: 105,
            hideDefaultActions: true,
        },
        {
@@ -130,7 +130,7 @@
                unitValue: { fieldName: "unitValue" },
                unitOptions: { fieldName: "unitOptions" },
                recordId: { fieldName: "Id" },
            },
            }
        },
        {
            label: "出货数量",
@@ -185,14 +185,13 @@
            label: "消耗品名称",
            fieldName: "Name__c",
            hideDefaultActions: true,
            initialWidth: 320,
            wrapText: true,
            sortable: true,
        },
        {
            label: "规格",
            fieldName: "packinglist",
            initialWidth: 80,
            initialWidth: 50,
            cellAttributes: { alignment: "right" },
            hideDefaultActions: true,
            wrapText: true,
@@ -201,24 +200,26 @@
            label: "CFDA状态",
            fieldName: "SFDA_Status__c",
            hideDefaultActions: true,
            initialWidth: 100,
            wrapText: true,
        },
        {
            label: "注册证编码号",
            fieldName: "approbation_No",
            hideDefaultActions: true,
            initialWidth: 170,
            wrapText: true,
        },
        {
            label: "注册证效期",
            fieldName: "expiration_Date",
            hideDefaultActions: true,
            initialWidth: 100,
            wrapText: true,
        },
        {
            label: "第3分类",
            fieldName: "Category3__c",
            initialWidth: 100,
            hideDefaultActions: true,
            sortable: true,
            wrapText: true,
@@ -226,7 +227,6 @@
        {
            label: "第4分类",
            fieldName: "Category4__c",
            initialWidth: 100,
            hideDefaultActions: true,
            sortable: true,
            wrapText: true,
@@ -234,7 +234,6 @@
        {
            label: "第5分类",
            fieldName: "Category5__c",
            initialWidth: 100,
            hideDefaultActions: true,
            sortable: true,
            wrapText: true,
@@ -249,15 +248,16 @@
        {
            label: "出货数量",
            fieldName: "Shipment_Count__c",
            initialWidth: 90,
            cellAttributes: { alignment: "right" },
            hideDefaultActions: true,
            initialWidth: 100,
            wrapText: true,
        },
        {
            label: "出货单价(元)",
            fieldName: "shippingUnitPrice",
            type: "number",
            initialWidth: 100,
            typeAttributes: {
                minimumFractionDigits: 2,
            },
@@ -270,9 +270,20 @@
    @track hospitalList = [];
    @track hospitalColumns = [
        {
            label: "",
            fieldName: "Id1",
            type: "button",
            hideDefaultActions: true,
            initialWidth: 90,
            typeAttributes: {
                label: "选择",
                name: "Id2",
                size: 1,
            },
        },
        {
            label: "医院名称",
            fieldName: "Name",
            initialWidth: 400,
            hideDefaultActions: true,
            wrapText: true,
        },
@@ -280,18 +291,7 @@
            label: "省份",
            fieldName: "stateMasterName",
            hideDefaultActions: true,
        },
        {
            label: "选择",
            fieldName: "Id1",
            type: "button",
            hideDefaultActions: true,
            typeAttributes: {
                label: "选择",
                name: "Id2",
                size: 1,
            },
        },
        }
    ];
    @track accountid = "";
@@ -312,6 +312,7 @@
            label: "消耗品名称",
            fieldName: "ProdName",
            hideDefaultActions: true,
            wrapText: true,
        },
        {
            label: "批次号",
@@ -348,13 +349,13 @@
            label: "消耗品明细2名称",
            fieldName: "orderdetails2NameUrl",
            type: "url",
            initialWidth: 150,
            typeAttributes: {
                label: { fieldName: "orderdetails2Name" },
                target: "_blank",
            },
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 240
        },
        {
            label: "单位",
@@ -366,6 +367,7 @@
        {
            label: "消耗品名称",
            fieldName: "ProdName",
            initialWidth: 100,
            hideDefaultActions: true,
            wrapText: true,
        },
@@ -380,14 +382,13 @@
            fieldName: "Bar_Code__c",
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 400
            initialWidth: 380
        },
        {
            label: "使用期限",
            fieldName: "Sterilization_limit__c",
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 120
        },
        {
            label: "出货数量",
@@ -414,8 +415,8 @@
            label: "消耗品明细2名称",
            fieldName: "orderdetails2Name",
            hideDefaultActions: true,
            initialWidth: 150,
            wrapText: true,
            initialWidth: 240
        },
        {
            label: "消耗品名称",
@@ -434,14 +435,14 @@
            label: "BarCode",
            fieldName: "Bar_Code__c",
            hideDefaultActions: true,
            initialWidth: 400
            wrapText: true,
            initialWidth: 380
        },
        {
            label: "使用期限",
            fieldName: "Sterilization_limit__c",
            hideDefaultActions: true,
            wrapText: true,
            initialWidth: 120
        },
        {
            label: "错误原因",
@@ -592,7 +593,7 @@
    defaultSortDirection = 'asc';
    sortDirection = 'asc';
    sortedBy;
    @track pageSize = 10;
    @track pageSize = 200;
    error;
    records;
    currentPageToken = 0;
@@ -602,11 +603,12 @@
    @track pageNumber = 1;
    @track paginationVisibility = false;
    @track totalPages = 1;
    pageSizeOptions = [10, 25, 50, 100];
    pageSizeOptions = [100, 200, 300];
    @track recordStart = 0;
    @track recordEnd = 0;
    //end
    @track SearchDone = '';
    @track hideCheckboxColumn = false;
    stylesLoaded = false;
    renderedCallback() {
@@ -621,6 +623,7 @@
                });
        }
    }
    //InvoiceProNotLabel    RrturnProLabel  InvoicedLabel
    @wire(getObjectInfo, { objectApiName: OPPORTUNITY_OBJECT })
@@ -652,8 +655,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;
        }
@@ -662,7 +669,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));
@@ -830,19 +838,26 @@
                this.Existarrive = r.entity.Existarrive;
                console.log("this.EditAble = " + this.EditAble);
                //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;
                    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);
                    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;
                    }
@@ -870,7 +885,7 @@
                    ) {
                        this.isPraseToPDFDisabled = false;
                    }
                    if ((coc.Billed_Status__c != "还没开票" || coc.SummonsStatus_c__c == "已完成") && this.agencyProType != 'ET') {
                    if ((coc.Billed_Status__c != "还没开票" || coc.SummonsStatus_c__c == "已完成")) {
                        this.isOpenReportDisabled = false;
                    }
                    if (
@@ -947,7 +962,7 @@
                        label: this.InvoiceProNotLabel,
                        fieldName: "InvoiceProNot_count__c",
                        type: "number",
                        initialWidth: 120,
                        initialWidth: 105,
                        typeAttributes: {
                            minimumFractionDigits: 2,
                        },
@@ -956,15 +971,15 @@
                    let object2 = {
                        label: this.RrturnProLabel,
                        fieldName: "RrturnPro_count__c",
                        initialWidth: 100,
                        cellAttributes: { alignment: "right" },
                        initialWidth: 100,
                        hideDefaultActions: true,
                    };
                    let object3 = {
                        label: this.InvoicedLabel,
                        fieldName: "Invoiced_Procount__c",
                        initialWidth: 100,
                        type: "number",
                        initialWidth: 100,
                        typeAttributes: {
                            minimumFractionDigits: 2,
                        },
@@ -986,6 +1001,7 @@
                            this.secondaryDistributor = "";
                            this.ForDealerText = "";
                            this.accountValue = "";
                            this.cocLwc['Order_ForDealerText__c'] = '';
                            this.isDisabledForDealerText = true;
                            this.isDisabledSecondaryDistributor = true;
                            break;
@@ -1026,9 +1042,9 @@
                if (this.hasHosPro) {
                    let object1 = {
                        label: "医院特价",
                        initialWidth: 80,
                        fieldName: "hospitalSpecialOffer",
                        type: 'boolean',
                        initialWidth: 100,
                        hideDefaultActions: true,
                    };
                    this.columns.push(object1);
@@ -1055,6 +1071,28 @@
                );
                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);
@@ -1079,6 +1117,7 @@
                this.isDisabledForCustomerText = false;
                this.secondaryDistributor = "";
                this.ForDealerText = "";
                this.cocLwc['Order_ForDealerText__c'] = '';
                this.isDisabledForDealerText = true;
                this.isDisabledSecondaryDistributor = true;
                this.isMutualTransferGoods = false;
@@ -1296,7 +1335,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;
@@ -1340,6 +1379,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 = [];
@@ -1371,13 +1412,17 @@
                    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"])
                    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;
@@ -1402,6 +1447,23 @@
                }
                this.data = tempData;
                //如果hasHosPro = true 医院特价
                console.log('this.hasHosPro = ' + this.hasHosPro);
                if (this.hasHosPro) {
                    let object1 = {
                        label: "医院特价",
                        fieldName: "hospitalSpecialOffer",
                        type: 'boolean',
                        initialWidth: 80,
                        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;
@@ -1517,9 +1579,7 @@
            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"] != '') {
@@ -1537,6 +1597,7 @@
                console.log('this.selectedRows = ' + JSON.stringify(this.selectedRows));
            }
        }
        this.data = [...this.data];
        this.ComputePrice(
            index,
            this.data[index].shipmentNumber,
@@ -1681,6 +1742,10 @@
        }
    }
    deepClone(obj) {
        return JSON.parse(JSON.stringify(obj));
    }
    saveConfirm() {
        this.isShowSpinner = true;
@@ -1698,13 +1763,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;
@@ -1779,17 +1845,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 reportUrl = this.label.ConsumableOutboundReportId;
        console.log("reportUrl = " + reportUrl);
        let url = "/report/" + reportUrl + "?reportFilters=" + encodeURIComponent(reportFilters);
        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) {
@@ -1872,17 +1941,17 @@
            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.showMyToast('成功', '上传成功', 'Success');
                this.getFiles();
            }).catch((error) => {
                this.showPopSpinner = false;
                console.log("error = " + error.message);
                this.showMyToast('失败', '上传失败', 'Error');
            });
            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() {
@@ -1891,24 +1960,24 @@
        getFiles({
            recordId: this.ESetid,
        }).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');
            });
            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() {
@@ -1928,7 +1997,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;
@@ -1971,29 +2040,64 @@
        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;
                    console.log('this.salesOrderdetails = ' + JSON.stringify(this.salesOrderdetails))
                    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.showMyToast('初始化失败', r.msg, 'Error');
            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.showMyToast('错误', '初始化失败', '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() {
@@ -2178,16 +2282,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'
        //     },
        // });
    }
    //删除
@@ -2468,23 +2574,22 @@
    //删除附件
    deleteAtt(event) {
        this.showLoadingSpinner = true;
        this.isShowSpinner = true;
        //var recordId = event.detail.data.recordId;
        var recordId = event.target.getAttribute("data-fileid");
        console.log('attid:' + recordId);
        deleteAtt(
            {
                contentVersionId: recordId
            }
        ).then(result => {
            if (result.result == 'Success') {
                this.showMyToast('成功', '删除成功', 'Success');
        deleteAtt({
            contentVersionId: recordId
        }).then(r => {
            r = JSON.parse(JSON.stringify(r));
            if (r.status == "Success") {
                this.showMyToast('删除成功', '', 'Success');
                this.getFiles();
            } else {
                this.showMyToast('删除失败', result.errorMsg, 'Error');
                this.showMyToast('删除失败', r.msg, 'Error');
            }
        }).catch(error => {
            this.showMyToast('错误', '删除失败', 'Error');
            this.showMyToast('错误', error.message, 'Error');
        })
    }
}