import { LightningElement, track, wire, api} from 'lwc'; import LightningConfirm from 'lightning/confirm'; import rentalApplyEquipmentSetReassign from '@salesforce/apex/RentalApplyEquipmentSetWebService.rentalApplyEquipmentSetReassign'; export default class lexReassign extends LightningElement { @api recordId; //只获取当前list选中的一览Id @api rentalApplySetIds; IsLoading=true; IsDisplay=true; //提示信息 msg; connectedCallback(){ console.log(this.recordId); console.log(JSON.stringify(this.rentalApplySetIds)); this.IsLoading=false; if (this.recordId && this.rentalApplySetIds) { this.IsDisplay = false; LightningConfirm.open({ message: '你确定要重新分配吗?', variant: 'headerless', label: 'this is the aria-label value', }).then(res=>{ if(res){ rentalApplyEquipmentSetReassign({ raesID: this.rentalApplySetIds[0] }).then(result=>{ this.IsDisplay = true; if(result == '1'){ this.msg = "已重新分配"; this.closeAction(); }else{ this.msg = result; return; } }) }else{ this.closeAction(); return; } }) }else{ this.msg = "请选择借出备品一览"; return; } } closeAction() { //返回当前的备品申请 window.open("/"+this.recordId,'_self'); } }