unknown
2023-07-06 7d283e2425891b5543ef27169faddaa3084ebf1b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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;
    //提示信息
    msg;
 
    connectedCallback(){
        console.log(this.recordId);
        console.log(JSON.stringify(this.rentalApplySetIds));
        // if(this.rentalApplySetIds.length<1){
        if (this.recordId && JSON.stringify(this.rentalApplySetIds)) {
            LightningConfirm.open({
                message: '你确定要重新分配吗?',
                variant: 'headerless',
                label: 'this is the aria-label value',
            }).then(res=>{
                if(res){
                    rentalApplyEquipmentSetReassign({
                        raesID: this.rentalApplySetIds[0]
                    }).then(result=>{
                        if(result == '1'){
                            this.msg = "已重新分配";
                            this.closeAction();
                        }else{
                            this.msg = result;
                            return;
                        }
                    })
                }
            })
        }else{
            this.msg = "请选择借出备品一览";
            return;
        }
    }
 
    closeAction() {
        //返回当前的备品申请
        window.open("/"+this.recordId,'_self');
    }
}