(function(){ X.pageLogic['yidong-pop'] = { init : function(parms){ var me = this; this.parms = parms; this.callback = parms.callback; //选择后执行的回调 var data = parms.extData;//获取到上层弹窗传的数据 var comboTree1,comboTree2 comboTree1 = $('.yidong-txt-box .justAnotherInputBox1').comboTree({ source : X.DATA.KanBanData, isMultiple: false }); comboTree2 = $('.yidong-txt-box .justAnotherInputBox2').comboTree({ source : X.DATA.ProjectData, isMultiple: false }); //叉图标关闭弹窗 $(".yidong-top .yidong-cha").click(function(){ console.log(layer.index) parent.layer.closeAll(layer.index); }); //取消按钮 $(".yidong-but-box .yidong-qx").click(function(){ layer.closeAll(layer.index); }); //我的看板,空间切换实践 $(".yidong-tab-box .yidong-tab div").click(function(){ $(".yidong-tab-box .yidong-tab div").removeClass('tabdata'); $(this).addClass('tabdata'); if($(this).html() == "我的看板"){ $(".yidong-txt-box .justAnotherInputBox1").show(); $(".yidong-txt-box .justAnotherInputBox2").hide(); }else { $(".yidong-txt-box .justAnotherInputBox1").hide(); $(".yidong-txt-box .justAnotherInputBox2").show(); } $(".yidong-txt-box .justAnotherInputBox1").val(""); $(".yidong-txt-box .justAnotherInputBox2").val(""); }) //确定按钮 $(".yidong-but-box .yidong-qd").click(function(){ var type ='kanban'; var id = '';//没有默认传看板 if($('#yidongjustAnotherInputBox2').val() != ""){ var Addlocation = $('#yidongjustAnotherInputBox2').val(); type = "kongjian" }else { var Addlocation = $('#yidongjustAnotherInputBox1').val(); } // console.log(Addlocation); if(Addlocation){ id = X.pageLogic.newkanban.matchingid(Addlocation,type); }else { alert('请选择添加的位置'); return; } var dataArr = { 'movepositionid': id, 'kanbandata':data.mykanban, 'kongjiandata':data.kongjian } X.api('api/yidong',dataArr,function(d){ if(d.code == "ok"){ X.pageLogic.dashboard.freshMenu();//刷新侧边栏 X.pageLogic.adminkanban.updata();//刷新数据 console.log(me.parms.layIndex); layer.closeAll(me.parms.layIndex); } }) }); } }; })();