import { LightningElement, track, wire } from 'lwc'; import serContact from '@salesforce/apex/LexSearchProductIraiController.serContact'; import init from '@salesforce/apex/LexSearchProductIraiController.init'; import Set_Name from '@salesforce/label/c.Set_Name'; import Search_Condition from '@salesforce/label/c.Search_Condition'; import Set_Search from '@salesforce/label/c.Set_Search'; import Set_Code from '@salesforce/label/c.Set_Code'; import Search from '@salesforce/label/c.Search'; import Search_Result from '@salesforce/label/c.Search_Result'; import Quantity from '@salesforce/label/c.Quantity'; import Valid_Status from '@salesforce/label/c.Valid_Status'; import Product_Search from '@salesforce/label/c.Product_Search'; import Add_Product from '@salesforce/label/c.Add_Product'; import Selected from '@salesforce/label/c.Selected'; import Asset_No from '@salesforce/label/c.Asset_No'; import Product_Name from '@salesforce/label/c.Product_Name'; import SFDA_Status from '@salesforce/label/c.SFDA_Status'; import ListPrice_In from '@salesforce/label/c.ListPrice_In'; import ListPrice_Out from '@salesforce/label/c.ListPrice_Out'; import Unit from '@salesforce/label/c.Unit'; export default class lexSearchProductIrai extends LightningElement { Label={ Set_Name, Search_Condition, Set_Search, Set_Code, Search_Result, Search, Quantity, Valid_Status, Product_Search, Add_Product, Selected, Asset_No, Product_Name, SFDA_Status, ListPrice_In, ListPrice_Out, Unit }; isLoad=false; data; LabelI=''; SearchName=''; SearchCode=''; columns = [ { label: '选择', fieldName: 'isSelected' }, { label: 'Report', fieldName: 'setUrl' }, { label: this.Label.Set_Name, fieldName: 'Name' }, { label: this.Label.Set_Code, fieldName: 'Product_Set_CD_c' }, { label: this.Label.Quantity, fieldName: 'Quantity' }, { label: this.Label.Valid_Status, fieldName: 'img' } // { label: 'Website', fieldName: 'Asset_Model_No_forPrint__c', type: 'url' }, // { label: 'Phone', fieldName: 'phone', type: 'phone' }, // { label: 'Balance', fieldName: 'amount', type: 'currency' }, // { label: 'CloseAt', fieldName: 'closeAt', type: 'date' }, ]; async connectedCallback(){ console.log("ddddd"); await init().then(res=>{ console.log("new res:"); console.log(res); this.data=res; this.isLoad=true; this.columns=[ { label: this.Label.Selected, fieldName: 'idx' }, { label: this.Label.Asset_No, fieldName: 'Name' }, { label: this.data.LabelOT, fieldName: 'OT_CODE_no_link__c' }, { label: this.Label.Product_Name, fieldName: 'Name' }, { label: this.data.Labelsuit, fieldName: 'suitDepartment__c' }, { label: this.data.LabelAl, fieldName: 'Alternative_Products__c' }, { label: this.Label.SFDA_Status, fieldName: 'SFDA_Status__c' }, { label: this.Label.ListPrice_In, fieldName: 'Intra_Trade_List_RMB__c' }, { label: this.Label.ListPrice_Out, fieldName: 'Foreign_Trade_List_US__c' }, { label: this.Label.Unit, fieldName: 'Qty_Unit__c' }, ] }) } serContact(){ serContact({trade:this.data.trade,searchMode:this.data.searchMode,celon:this.data.celon,SearchName:this.data.SearchName}).then(res=>{ console.log(res); this.data.cl=res.cl; if(res!=null){ this.data.cl=res.cl; this.data.activities=res.activities; this.data.cc=[]; for (var i = this.data.cl.length - 1; i >= 0; i--) { this.data.cc.push(this.data.cl[i].pbe.Product2) } console.log("activities!"); } let t=this.data; this.data={}; this.data=t; }) } searchNameInputChange(event){ this.data.SearchName = event.detail.value; } // QuoteEntryMaxLine = window.opener.QuoteEntryMaxLine; add(){ setProductList(); return false; } setProductList() { var nextLine = top.window.opener.getLastLineNoNext(window.opener.document); var hasCheckedCnt = 0; var checklist = j$("input[name='checklist']");            for(var i=0; i