buli
2023-06-05 d324588faa5120c95321425a06de683e8aae445b
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js
@@ -96,6 +96,7 @@
        hideDefaultActions: true,
        wrapText: true,
        cellAttributes: { alignment: 'right' },
        type: "number",
        typeAttributes: {
            minimumFractionDigits: 2,
@@ -160,6 +161,7 @@
        label: "产品型号",
        fieldName: "esdAssetModelNo",
        hideDefaultActions: true,
        wrapText: true,
    },
    {
        label: "规格",
@@ -211,13 +213,13 @@
    },
    {
        label: "开票单位",
        //fieldName: "esdInvoiceUnit",
        hideDefaultActions: true,
        type: "customUnit",
        typeAttributes: {
            unitValue: { fieldName: "unitValue" },
            unitOptions: { fieldName: "unitOptions" },
            recordId: { fieldName: "recordId" },
            isDisabled: { fieldName: "isDisabled" },
        },
    },
    {
@@ -247,6 +249,7 @@
        fieldName: "invoiceAllprice",
        hideDefaultActions: true,
        type: "number",
        initialWidth: 150,
        typeAttributes: {
            minimumFractionDigits: 2,
        },
@@ -497,8 +500,14 @@
                        this.detailsData[i]['esdInvoicedProcount'] = this.detailsData[i].esd.Invoiced_Procount__c;
                        this.detailsData[i]['esdInvoiceProNotCount'] = this.detailsData[i].esd.InvoiceProNot_count__c;
                        //开票单位
                        this.detailsData[i]['unitValue'] = this.detailsData[i].esd.Invoice_Unit__c;
                        //this.detailsData[i].esd.Box_Piece__c
                        //this.detailsData[i]['unitValue'] = this.detailsData[i].esd.Invoice_Unit__c;
                        this.detailsData[i]['unitValue'] = this.detailsData[i].esd.Box_Piece__c;
                        console.log('unitValue = ' + this.detailsData[i]['unitValue']);
                        this.detailsData[i]['recordId'] = this.detailsData[i].esd.Id;
                        //disabled="{!IF(records.esd.Box_Piece__c =='个' || (records.esd.Box_Piece__c =='盒' && records.Packing_list_manual ==1),true,false)}"
                        //this.detailsData[i]['isDisabled'] = (this.detailsData[i].esd.Box_Piece__c == '个' || (this.detailsData[i].esd.Box_Piece__c =='盒' && this.detailsData[i].Packing_list_manual ==1)) ? true:false;
                        this.detailsData[i]['isDisabled'] = true;
                        let unitOptions = [];
                        for (var key in this.detailsData[i].Invoice_UnitOptsMap) {
                            let unitOption = {};
@@ -585,6 +594,7 @@
                    this.isChange = r.entity.isChange;
                    this.ExistOutbound = r.entity.ExistOutbound;
                    this.outboundData = r.entity.invoiceOrderRecoeds;
                    console.log('this.outboundData = ' + JSON.stringify(this.outboundData))
                    this.done = r.entity.done;
                    this.accountid = r.entity.accountid;
                    this.userWorkLocation = r.entity.userWorkLocation;
@@ -949,7 +959,22 @@
    SaveJs() {
        this.isShowSpinner = true;
        let cloneData = this.outboundData
        debugger
        const selectedRows = this.template.querySelector("[data-field='outbound']").getSelectedRows();
        console.log('selectedRows = ' + JSON.stringify(selectedRows));
        for (var i in cloneData) {
            let b = false;
            for (var j in selectedRows) {
                if (cloneData[i].esd.Id == selectedRows[j].esd.Id) {
                    b = true;
                    cloneData[i].check = true;
                }
            }
            if(!b){
                cloneData[i].check = false;
            }
            delete cloneData[i].esdOutboundDate;
            delete cloneData[i].esdNameUrl;
            delete cloneData[i].esdName;
@@ -1210,8 +1235,21 @@
    InvoiceorderSearchJs() {
        this.isShowSpinner = true;
        debugger
        let cloneData = this.outboundData
        const selectedRows = this.template.querySelector("[data-field='outbound']").getSelectedRows();
        console.log('selectedRows ' + JSON.stringify(selectedRows));
        for (var i in cloneData) {
            let b = false;
            for (var j in selectedRows) {
                if (cloneData[i].esd.Id == selectedRows[j].esd.Id) {
                    b = true;
                    cloneData[i].check = true;
                }
            }
            if(!b){
                cloneData[i].check = false;
            }
            delete cloneData[i].esdOutboundDate;
            delete cloneData[i].esdNameUrl;
            delete cloneData[i].esdName;
@@ -1231,6 +1269,7 @@
        console.log('this.HospitalInfo = ' + this.HospitalInfo);
        console.log('SecondDealer = ' + this.secondaryDistributor);
        console.log('invoiceOrderRecoedsLwc = ' + JSON.stringify(cloneData));
        InvoiceorderSearch({
            cocLwc: this.coc,
            invoiceIdLwc: this.invoiceId,
@@ -1245,8 +1284,14 @@
            console.log("r = " + JSON.stringify(r));
            if (r.status == "Success") {
                this.outboundData = r.entity.invoiceOrderRecoeds;
                console.log('this.outboundData = ' + JSON.stringify(this.outboundData));
                let index = 0;
                this.selectedRows = [];
                for (var i in this.outboundData) {
                    if(this.outboundData[i].check)
                        this.selectedRows.push(this.outboundData[i].esd.Id)
                    this.outboundData[i].Id = this.outboundData[i].esd.Id;
                    this.outboundData[i]['esdOutboundDate'] = this.outboundData[i].esd.Outbound_Date__c;
                    this.outboundData[i]['esdNameUrl'] = '/s/lexsummonscreat?ESetid=' + this.outboundData[i].esd.Id;
                    this.outboundData[i]['esdName'] = this.outboundData[i].esd.Name;
@@ -1292,6 +1337,7 @@
                    //计算发票票面金额
                    this.sumPrice += this.outboundData[i].needInvoiceCount;
                }
                console.log('this.selectedRows = ' + JSON.stringify(this.selectedRows))
                this.isShowSpinner = false;
            } else {
                this.showMyToast('搜索失败', r.msg, 'Error');
@@ -1303,20 +1349,20 @@
    }
    getSelectedRows(event) {
        console.log("getSelectedRows ");
        for (var i in this.outboundData) {
            this.outboundData[i].check = false;
        }
        const selectedRows = event.detail.selectedRows;
        for (var i in this.outboundData) {
            for (var j in selectedRows) {
                if (this.outboundData[i].esd.Id == selectedRows[j].esd.Id) {
                    //this.outboundData[i].check = !this.outboundData[i].check;
                    this.outboundData[i].check = true;
                }
            }
        }
        console.log('this.outboundData = ' + JSON.stringify(this.outboundData));
        // console.log("getSelectedRows ");
        // for (var i in this.outboundData) {
        //     this.outboundData[i].check = false;
        // }
        // const selectedRows = event.detail.selectedRows;
        // for (var i in this.outboundData) {
        //     for (var j in selectedRows) {
        //         if (this.outboundData[i].esd.Id == selectedRows[j].esd.Id) {
        //             //this.outboundData[i].check = !this.outboundData[i].check;
        //             this.outboundData[i].check = true;
        //         }
        //     }
        // }
        // console.log('this.outboundData = ' + JSON.stringify(this.outboundData));
    }
    deleteButtonJs() {
@@ -1705,7 +1751,7 @@
            contentVersionId: recordId
        }).then(result => {
            if (result.result == 'Success') {
                this.showMyToast('成功', '删除成功', 'Success');
                this.showMyToast('删除成功', '', 'Success');
                if (this.fileData.length == 1)
                    window.location.reload();
                else