19626
2023-05-09 3d312e60e65de7bd0194c50ae26d11c7a4d4fc73
force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-04-20 15:04:03
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-04-25 17:37:35
 * @LastEditTime: 2023-04-26 11:45:00
 */
/*
 * @Description: 
@@ -14,6 +14,45 @@
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-04-20 17:11:01
 */
const columns = [
    {
      label: '失单品牌',
      fieldName: 'LostBrandName__c',
      type: 'list',
      editable: true
    },
    {
      label: '失单对手型号',
      fieldName: 'LostProductName__c',
      type: 'text',
      editable: true
    },
    {
        label: '失单数量',
        fieldName: 'Quantity__c',
        type: 'number',
        editable: true
    },
    {
    label: '失单对手型号(手动)',
    fieldName: 'LostProductMannual__c',
    type: 'text',
    editable: true
    },
    {
    label: '失单产品类别',
    fieldName: 'ProductClass__c',
    type: 'list',
    editable: true
    },
    {
    label: '失单产品区分',
    fieldName: 'ProductCategory__c',
    type: 'list',
    editable: true
    }
    // ...
  ];
import { api, wire,track,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import save from '@salesforce/apex/lexPCLLostReportLwcController.save';
@@ -22,7 +61,8 @@
import setbrand from '@salesforce/apex/lexPCLLostReportLwcController.setBrand';
import init from '@salesforce/apex/lexPCLLostReportLwcController.init';
import initForApex from '@salesforce/apex/lexPCLLostReportLwcController.initForApex';
import getValuesFromTable from '@salesforce/apex/lexPCLLostReportLwcController.getValuesFromTable';
import multiSelectCombobox from 'c/multiSelectCombobox'
import searchBrands from '@salesforce/apex/lexPCLLostReportLwcController.searchBrands';
export default class LexPCLLostReportPage extends LightningElement {
    @api oppId = '0061000001R2xjWAAR';
    @api lostReportId;
@@ -32,11 +72,18 @@
    searchResult;
    LostReport;
    brandCount;
    brandOptions = [];
    connectedCallback() {
        this.initAll();
        searchBrands().then(result=>{
            this.brandOptions = JSON.parse(result);
            console.log(this.brandOptions);
            const multiCombobox = this.template.querySelector('c-multi-select-combobox');
            multiCombobox.refreshOptions(this.brandOptions);
        }).catch(error=>{
            console.log("error");
            console.log(error);
        });
    }
    
@@ -63,6 +110,7 @@
    //     this.initAll();
    // }
    
    // connectedCallback(){
    //     console.log("1");
    //     initForApex({
@@ -87,14 +135,7 @@
    //         });
    //     });
    // }
    handleSearchBrand(event){
        const searchText = event.target.value;
        searchBrand({
            name: searchText
        }).then(result=>{
            this.searchResult = result;
        });
    }
    initAll(){
        console.log(this.oppId);
        console.log(this.lostReportId);
@@ -117,7 +158,7 @@
                            this.LostReport = result.LostReport;
                        }else{
                            console.log("211");
                            this.showToast(result.message,"error");
                            //this.showToast(result.message,"error");
                            console.log("985");
                        }
                    });