| | |
| | | * @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: |
| | |
| | | * @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'; |
| | |
| | | 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; |
| | |
| | | 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); |
| | | }); |
| | | } |
| | | |
| | | |
| | |
| | | // this.initAll(); |
| | | // } |
| | | |
| | | |
| | | // connectedCallback(){ |
| | | // console.log("1"); |
| | | // initForApex({ |
| | |
| | | // }); |
| | | // }); |
| | | // } |
| | | handleSearchBrand(event){ |
| | | const searchText = event.target.value; |
| | | searchBrand({ |
| | | name: searchText |
| | | }).then(result=>{ |
| | | this.searchResult = result; |
| | | }); |
| | | } |
| | | |
| | | initAll(){ |
| | | console.log(this.oppId); |
| | | console.log(this.lostReportId); |
| | |
| | | this.LostReport = result.LostReport; |
| | | }else{ |
| | | console.log("211"); |
| | | this.showToast(result.message,"error"); |
| | | //this.showToast(result.message,"error"); |
| | | console.log("985"); |
| | | } |
| | | }); |