unknown
2023-07-19 f455c37efbe2ddd8d6bc1bec67ca079bb7373402
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
47
48
49
50
51
52
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');
    }
}