猎户系统

32.69bdeff453d3d2240c6d.js 13KB

1
  1. webpackJsonp([32],{KdQU:function(t,i,e){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var a=e("Xxa5"),n=e.n(a),o=e("exGp"),s=e.n(o),l=e("//Fk"),r=e.n(l),d={name:"promoteManage",components:{selectModule:e("K1Y0").a},data:function(){return{loading:!1,groupLoading:!1,dialogLoading:!1,dialogGroupVisible:!1,dialogTableVisible:!1,dialogTitleName:"添加推广位",tableData:[],id:"",desCol:[{prop:"pid_name",label:"推广位名称",min_width:"160px"},{prop:"pid",label:"推广位ID",min_width:"200px"},{prop:"account_id",label:"淘宝账号ID"},{prop:"site_id",label:"媒体ID"},{prop:"groupCount",label:"分组数量"},{prop:"operate",label:"操作",min_width:"160px"}],desColGroup:[{prop:"group_name",label:"分组名称"},{prop:"group_manager",label:"负责人"}],tableDataGroup:[],tb_account_id:"",tbAcIdOption:[],site_name:"",site_id:"",siteIdOptions:[],pid:"",pid_name:"",groupList:[],groupId:[],dialogGroupTitle:"分组名称",pidNameOptionList:[],pidOptionList:[],pidNameRef:null,pidRef:null,statusRef:null,statusOptionList:[{key:0,name:"所有"},{key:1,name:"启用"},{key:2,name:"禁用"}]}},mounted:function(){var t=this;this.$nextTick(function(){t.$refs.statusRef.value=1,t.init(),t.getFilterList()})},methods:{statusRowClassName:function(t){var i=t.row;t.rowIndex;if(2===i.is_show)return"abadon"},setAdzoneEvent:function(t){var i=this;this.$confirm("确定要"+(1==t.is_show?"禁用":"启用")+"("+t.pid_name+")?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){i.$axios.post(i.URL.BASEURL+i.URL.promote_setAdzone,{id:t.id,is_show:1==t.is_show?2:1}).then(function(t){(t=t.data)&&0==t.errno?i.init():i.$message({message:t.err,type:"warning"})})}).catch(function(){})},deleteSystemAccount:function(t){var i=this;this.$confirm("确定要删除("+t.pid_name+")?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){i.$loading(i.$loadingConfig),i.$axios.post(i.URL.BASEURL+i.URL.promoteManage_dele,{id:t.id}).then(function(t){t=t.data;i.$loading(i.$loadingConfig).close(),t&&0==t.errno?i.init():i.$message({message:t.err,type:"warning"})}).catch(function(){i.$loading(i.$loadingConfig).close()})}).catch(function(){})},getFilterList:function(){var t=this,i=this.$localSelfStore.getLocal("tbAcId")&&"undefined"!=this.$localSelfStore.getLocal("tbAcId")?JSON.parse(this.$localSelfStore.getLocal("tbAcId")):"";""!=i&&this.$axios.get(this.URL.BASEURL+this.URL.promoteManage_list,{params:{account_id:i}}).then(function(i){(i=i.data)&&0==i.errno?(t.pidNameOptionList=i.rst,t.pidOptionList=i.rst):4002!=i.errno&&t.$message({message:i.err,type:"warning"})})},init:function(){var t=this,i=this.$localSelfStore.getLocal("tbAcId")&&"undefined"!=this.$localSelfStore.getLocal("tbAcId")?JSON.parse(this.$localSelfStore.getLocal("tbAcId")):"";""!=i&&(this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.promoteManage_list,{params:{account_id:i,pid:this.$refs.pidRef.value,is_show:this.$refs.statusRef.value,pid_name:this.pidNameOptionList&&this.pidNameOptionList.length>0&&this.$refs.pidNameRef.value?this.pidNameOptionList[this.pidNameOptionList.findIndex(function(i){return i.pid==t.$refs.pidNameRef.value})].pid_name:""}}).then(function(i){(i=i.data)&&0==i.errno?t.tableData=i.rst:4002!=i.errno&&t.$message({message:i.err,type:"warning"}),t.loading=!1}).catch(function(){t.loading=!1}))},handleCheck:function(){var t=this;return new r.a(function(i,e){t.tb_account_id+""==""?(t.$message({message:"淘宝账号ID为必填项",type:"warning"}),e()):t.site_id+""==""?(t.$message({message:"媒体ID为必填项",type:"warning"}),e()):t.pid+""==""?(t.$message({message:"推广位ID",type:"warning"}),e()):t.pid_name+""==""?(t.$message({message:"推广位名称为必填项",type:"warning"}),e()):i()})},addEditManager:function(){var t=this;return s()(n.a.mark(function i(){var e,a;return n.a.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,t.handleCheck();case 2:if(e=t.URL.promoteManage_add,a={sys_group_id:1==t.$cookie.getCookie("isSuperManage")?sessionStorage.getItem("company_session_defaultCorp_level_1").toString():"",account_id:t.tb_account_id,site_id:t.site_id,pid:t.pid,pid_name:t.pid_name,group_ids:t.groupId.join(";")},"编辑推广位"!=t.dialogTitleName){i.next=10;break}if(""!=t.id){i.next=8;break}return t.$message({message:"id获取不到",type:"warning"}),i.abrupt("return",!1);case 8:e=t.URL.promoteManage_edit,a.id=t.id;case 10:t.dialogLoading=!0,t.$axios.post(t.URL.BASEURL+e,a).then(function(i){i=i.data;t.dialogLoading=!1,i&&0==i.errno&&(t.dialogTableVisible=!1,t.init()),t.$message({message:i.err,type:"warning"})}).catch(function(){t.dialogLoading=!1});case 12:case"end":return i.stop()}},i,t)}))()},openDialog:function(t,i){var e=this;return s()(n.a.mark(function a(){return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,e.inittbList();case 2:e.initGroupListinDialog(),"edit"==t?(e.groupId=[],e.dialogTitleName="编辑推广位",e.id=i.id,e.tb_account_id=i.account_id,e.site_id=i.site_id,e.pid=i.pid,e.pid_name=i.pid_name,e.initSiteIds(),e.initPidInGroup(i.pid)):(e.id="",e.dialogTitleName="添加推广位",e.tb_account_id="",e.site_id="",e.pid="",e.pid_name="",e.groupId=[]),e.dialogTableVisible=!0;case 5:case"end":return a.stop()}},a,e)}))()},initGroupListinDialog:function(){var t=this;this.$axios.get(this.URL.BASEURL+this.URL.promoteManage_groupListInDialog,{params:{sys_group_id:1==this.$cookie.getCookie("isSuperManage")?sessionStorage.getItem("company_session_defaultCorp_level_1").toString():""}}).then(function(i){(i=i.data)&&0==i.errno?t.groupList=i.rst:4002!=i.errno&&t.$message({message:i.err,type:"warning"})})},inittbList:function(){var t=this;this.$axios.get(this.URL.BASEURL+this.URL.tbManage_list,{params:{sys_group_id:1==this.$cookie.getCookie("isSuperManage")?sessionStorage.getItem("company_session_defaultCorp_level_1").toString():""}}).then(function(i){(i=i.data)&&0==i.errno?t.tbAcIdOption=i.rst:4002!=i.errno&&t.$message({message:i.err,type:"warning"})})},tbChangeEvent:function(){this.site_id="",this.siteIdOptions=[],this.tb_account_id&&this.initSiteIds()},initSiteIds:function(){var t=this;this.$axios.get(this.URL.BASEURL+this.URL.promoteManage_siteList,{params:{account_id:this.tb_account_id}}).then(function(i){(i=i.data)&&0==i.errno?t.siteIdOptions=i.rst:4002!=i.errno&&t.$message({message:i.err,type:"warning"})})},previewGroupDetial:function(t){this.dialogGroupVisible=!0,this.dialogGroupTitle=t.pid_name,this.initPidInGroup(t.pid)},initPidInGroup:function(t){var i=this;this.groupLoading=!0,this.$axios.get(this.URL.BASEURL+this.URL.promoteManage_groupList,{params:{pid:t}}).then(function(t){i.groupLoading=!1,(t=t.data)&&0==t.errno?(i.tableDataGroup=t.rst,i.tableDataGroup.forEach(function(t){i.groupId.push(t.id)})):4002!=t.errno&&i.$message({message:t.err,type:"warning"})}).catch(function(){i.groupLoading=!1})}}},p={render:function(){var t=this,i=t.$createElement,e=t._self._c||i;return e("div",{staticClass:"con"},[e("div",{staticClass:"tableInfo"},[e("selectModule",{ref:"pidNameRef",attrs:{title:"推广位名称",labelWidthAuto:!0,options:t.pidNameOptionList,k:"pid",v:"pid_name"},on:{change:function(i){return t.init()}}}),t._v(" "),e("selectModule",{ref:"pidRef",attrs:{title:"推广位ID",options:t.pidOptionList,k:"pid",v:"pid"},on:{change:function(i){return t.init()}}}),t._v(" "),e("selectModule",{ref:"statusRef",attrs:{title:"状态",clearable:!1,options:t.statusOptionList,k:"key",v:"name"},on:{change:function(i){return t.init()}}}),t._v(" "),e("el-button",{staticClass:"lMarauto",attrs:{size:"mini",type:"primary"},on:{click:function(i){return t.openDialog("add")}}},[t._v("添加推广位")])],1),t._v(" "),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"tableCon",staticStyle:{width:"100%"},attrs:{data:t.tableData,"tooltip-effect":"dark","row-class-name":t.statusRowClassName,height:"calc(100vh - 140px)"}},[t._l(t.desCol,function(i){return[e("el-table-column",{key:i.prop,attrs:{label:i.label,align:"center","show-overflow-tooltip":i.showOverTooltip,"min-width":i.min_width?i.min_width:110},scopedSlots:t._u([i.tooltip?{key:"header",fn:function(){return[t._v("\n "+t._s(i.label?i.label:"-")+"\n "),e("el-tooltip",{staticClass:"disinblock",attrs:{content:i.tooltip,placement:"top"}},[e("i",{staticClass:"el-icon-question"})])]},proxy:!0}:null,{key:"default",fn:function(a){return["operate"==i.prop?e("div",[e("div",{staticClass:"flex f13",staticStyle:{padding:"0 10px","font-size":"13px","justify-content":"center"}},[e("div",{staticClass:"pointer",class:1==a.row.is_show?"c-theme":"c-46a7ff",on:{click:function(i){return t.setAdzoneEvent(a.row)}}},[t._v(t._s(1==a.row.is_show?"禁用":"启用"))]),t._v(" "),e("div",{staticClass:"lMar14 pointer c-theme",on:{click:function(i){return t.openDialog("edit",a.row)}}},[t._v("编辑")]),t._v(" "),e("div",{staticClass:"lMar14 pointer",on:{click:function(i){return t.deleteSystemAccount(a.row)}}},[t._v("删除")])])]):"groupCount"==i.prop?e("div",[e("span",[t._v(t._s(a.row[i.prop]||0==a.row[i.prop]?a.row[i.prop]:"-"))]),t._v(" "),e("span",{staticClass:"lMar5 c-theme pointer",on:{click:function(i){return t.previewGroupDetial(a.row)}}},[t._v("查看")])]):e("div",[t._v(t._s(a.row[i.prop]||0==a.row[i.prop]?a.row[i.prop]:"-"))])]}}],null,!0)})]})],2),t._v(" "),e("el-dialog",{staticClass:"dialogCon_permission",attrs:{title:t.dialogTitleName,visible:t.dialogTableVisible,"append-to-body":!0,width:"600px"},on:{"update:visible":function(i){t.dialogTableVisible=i}}},[e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.dialogLoading,expression:"dialogLoading"}],staticClass:"dialogCon"},[e("div",{staticClass:"itemBox",staticStyle:{"margin-top":"0"}},[e("div",{staticClass:"name"},[e("span",{staticClass:"starLabel"},[t._v("*")]),t._v("淘宝账号ID:")]),t._v(" "),e("div",{staticClass:"ipt"},[e("el-select",{attrs:{size:"small",placeholder:"请选择淘宝账号ID",clearable:"",filterable:""},on:{change:t.tbChangeEvent},model:{value:t.tb_account_id,callback:function(i){t.tb_account_id=i},expression:"tb_account_id"}},t._l(t.tbAcIdOption,function(t){return e("el-option",{key:t.account_id,attrs:{label:t.tb_nickname,value:t.account_id}})}),1)],1)]),t._v(" "),e("div",{staticClass:"itemBox"},[e("div",{staticClass:"name"},[e("span",{staticClass:"starLabel"},[t._v("*")]),t._v("媒体ID:")]),t._v(" "),e("div",{staticClass:"ipt"},[e("el-select",{attrs:{size:"small",placeholder:"请选择媒体ID",clearable:"",filterable:""},model:{value:t.site_id,callback:function(i){t.site_id=i},expression:"site_id"}},t._l(t.siteIdOptions,function(t){return e("el-option",{key:t.site_id,attrs:{label:t.site_name,value:t.site_id}})}),1)],1)]),t._v(" "),e("div",{staticClass:"itemBox"},[e("div",{staticClass:"name"},[e("span",{staticClass:"starLabel"},[t._v("*")]),t._v("推广位名称:")]),t._v(" "),e("div",{staticClass:"ipt"},[e("el-input",{attrs:{size:"small",placeholder:"请输入推广位名称"},model:{value:t.pid_name,callback:function(i){t.pid_name=i},expression:"pid_name"}})],1)]),t._v(" "),e("div",{staticClass:"itemBox"},[e("div",{staticClass:"name"},[e("span",{staticClass:"starLabel"},[t._v("*")]),t._v("推广位ID:")]),t._v(" "),e("div",{staticClass:"ipt"},[e("el-input",{attrs:{size:"small",placeholder:"请输入推广位ID"},model:{value:t.pid,callback:function(i){t.pid=i},expression:"pid"}})],1)]),t._v(" "),e("div",{staticClass:"itemBox"},[e("div",{staticClass:"name"},[t._v("分组:")]),t._v(" "),e("div",{staticClass:"ipt"},[e("el-select",{attrs:{size:"small",placeholder:"请选择分组ID",clearable:"",filterable:"",multiple:"","collapse-tags":!0},model:{value:t.groupId,callback:function(i){t.groupId=i},expression:"groupId"}},t._l(t.groupList,function(t){return e("el-option",{key:t.id,attrs:{label:t.group_name,value:t.id}})}),1)],1)])]),t._v(" "),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{attrs:{size:"mini"},on:{click:function(i){t.dialogTableVisible=!1}}},[t._v("取 消")]),t._v(" "),e("el-button",{attrs:{size:"mini",type:"primary"},on:{click:t.addEditManager}},[t._v("确 定\n ")])],1)]),t._v(" "),e("el-dialog",{attrs:{title:t.dialogGroupTitle,visible:t.dialogGroupVisible,"append-to-body":!0,width:"500px"},on:{"update:visible":function(i){t.dialogGroupVisible=i}}},[e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.groupLoading,expression:"groupLoading"}]},[e("el-table",{staticClass:"tableCon",staticStyle:{width:"100%"},attrs:{data:t.tableDataGroup,"tooltip-effect":"dark",height:"400px"}},[t._l(t.desColGroup,function(i){return[e("el-table-column",{key:i.prop,attrs:{label:i.label,align:"center","min-width":i.min_width?i.min_width:110},scopedSlots:t._u([{key:"default",fn:function(a){return[e("div",[t._v(t._s(a.row[i.prop]||0==a.row[i.prop]?a.row[i.prop]:"-"))])]}}],null,!0)})]})],2)],1)])],1)},staticRenderFns:[]};var c=e("VU/8")(d,p,!1,function(t){e("Ulzp"),e("jzYq")},"data-v-630b5002",null);i.default=c.exports},Ulzp:function(t,i){},jzYq:function(t,i){}});