(function(){
    X.pageLogic['copyreport'] = {
        init : function(parms){
            var me = this;
            this.parms = parms;
            this.callback = parms.callback; //选择后执行的回调
            var data = parms.extData;//获取到上层弹窗传的数据
            console.log(data);
            
            X.api("project/","get",{},function(d){
                X.laytpldata("#project-list-box-dot",d,".project-list-box");
                layui.form.render();
            });
            var dest_project_id;//項目id
            layui.form.on('select(projectlist)', function(data){
                console.log(data);
                dest_project_id = data.value;
            });

            //确定按钮
            $(document).off('click','.yidong-but-box .yidong-qd').on('click','.yidong-but-box .yidong-qd',function(){
                var report_ids = [];
                report_ids.push(data);
                var dataArr = {
                    'dest_project_id': dest_project_id,
                    'report_ids': report_ids
                };
                console.log(dataArr);
                X.api('report/copy','post',dataArr,function(d){
                    
                    layer.closeAll(0);
                })
            });

        }
    };
})();