import { LightningElement,track } from 'lwc'; import GetNormalProductSearch from '@salesforce/apex/OpportunityService.GetNormalProductSearch'; import saveInquiryData from '@salesforce/apex/OpportunityService.saveInquiryData'; import saveInquiryDataTemp from '@salesforce/apex/OpportunityService.saveInquiryDataTemp'; export default class test02 extends LightningElement { //==================获取招投标项目id================ ParamIdStr = ''; getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0;i { debugger var jzselectInquiry=[]; var jzInquiry=[]; var responseObj = JSON.parse(result); // this.jzData = responseObj.records; responseObj.records.forEach(item=>{ if(item.Bidding_Project_Name_Bid__c!=undefined){ jzselectInquiry.push(item); }else{ jzInquiry.push(item); } }); this.jzData=[...jzselectInquiry,...jzInquiry]; console.warn(this.jzData); this.tableIsLoding = false; }) } //选中 @track SelectedFnDate=[] SelectedFn(event){ let arr = event.detail.rows; var arrr=[]; arr.forEach(item=>{ if(item.Bidding_Project_Name_Bid__c!=undefined){ this.ErrorTongzhishow = true; setTimeout(()=>{ this.ErrorTongzhishow = false; },2000) }else{ arrr.push(item); } }); this.SelectedFnDate = arrr; } //保存 saveInquiry(){ debugger; var newTemp=[]; this.SelectedFnDate.forEach(item=>{ let Temp = {}; Temp.Id=item.Id; Temp.BiddingProjectNameBidc=this.ParamIdStr; newTemp.push(Temp); }); var jsondata=JSON.stringify(newTemp); debugger; saveInquiryData({JsonStr:jsondata}).then(result => { debugger; var resultObject = JSON.parse(result); console.warn(resultObject); }); // saveInquiryDataTemp().then(result=>{ // var a = result; // debugger;x // }); } }