webpackJsonp([84],{DxdI:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=a("2eFk"),n=a("Ke24"),i=a("fPyK"),l=a("P9l9"),r=a("Ch4/"),s=a("3E4D"),c={name:"reviewed",props:{brandId:{type:String,default:function(){return""}}},data:function(){return{dialogVisible:!1,tableH:window.screen.availHeight-464-126+"px",topMenuData:[{id:"1",name:"自定义报表"}],activeId:"1",activeTab:"1",activeBrand:"1",tableData:[],multipleSelection:[]}},computed:{},methods:{changeRouter:function(e){this.$router.push(e)},setSelectTab:function(e){this.activeTab=e.tabId},handlePreview:function(e,t){var a=window.location.origin+"/office-mobile/#/defineTemplate?templateId="+t.dailyReportTemplateId;this.$refs.qrcodePreview.qrcode(a,"daily-preview"),this.dialogVisible=!0},toCustomSet:function(){this.changeRouter("/template?brandId="+this.brandId+"&appIcon="+this.$route.query.appIcon)},handleCopy:function(e,t){this.changeRouter("/template?brandId="+this.brandId+"&templateId="+t.dailyReportTemplateId+"&type=copy&appIcon="+this.$route.query.appIcon)},handleEdit:function(e,t){this.changeRouter("/template?brandId="+this.brandId+"&templateId="+t.dailyReportTemplateId+"&type=edit&appIcon="+this.$route.query.appIcon)},handleDelete:function(e,t){var a=this;a.$confirm("一旦删除之后，该范围的门店将无法接收该日报，是否确定删除？","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){a.deleteTemplate(e,t)}).catch(function(){})},deleteTemplate:function(e,t){var a=this;Object(l.e)("/haoban-app-daily-web/daily/del-define-template",{templateId:t.dailyReportTemplateId}).then(function(t){var o=t.data;if(1==o.errorCode)return s.a.showmsg("删除成功","success"),void a.tableData.splice(e,1);r.a.errorMsg(o)}).catch(function(e){a.$message.error({duration:1e3,message:e.message})})},getData:function(){var e=this;Object(l.e)("/haoban-app-daily-web/daily/list-define-template",{brandId:e.brandId}).then(function(t){var a=t.data;if(1==a.errorCode)return e.tableData=[],void(a.result&&a.result.length&&(e.tableData=a.result));r.a.errorMsg(a)}).catch(function(t){e.$message.error({duration:1e3,message:t.message})})}},watch:{brandId:function(e,t){e&&(this.activeBrand=e,this.getData())}},mounted:function(){document.documentElement.style.backgroundColor="#f0f2f5",this.$emit("showTab","212"),this.brandId&&this.getData()},destroyed:function(){document.documentElement.style.backgroundColor="#fff"},components:{appDetail:o.a,commonDetailTop:n.a,qrcodeDialog:i.a}},d={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"custom-set-wrap"},[a("common-detail-top",{attrs:{topMenuData:e.topMenuData,activeId:e.activeId}}),e._v(" "),a("div",{staticClass:"custom-set-content boder-box"},[a("div",{staticClass:"flex flex-space-between flex-pack-center m-b-23 m-t-30"},[a("div",{staticClass:"custom-set-title flex flex-pack-center"},[a("span",[e._v("模板列表（"+e._s(e.tableData.length)+"）")]),e._v(" "),a("span",{staticClass:"font-14 color-909399"},[e._v("注：创建自定义日报后才能下发日报")])]),e._v(" "),a("div",[a("el-button",{attrs:{type:"button"},on:{click:function(t){e.toCustomSet("")}}},[e._v("新建模板")])],1)]),e._v(" "),a("el-table",{ref:"multipleTable",staticClass:"select-table",staticStyle:{width:"100%"},attrs:{data:e.tableData,"tooltip-effect":"dark"}},[a("el-table-column",{attrs:{label:"模板名称","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.title))]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"name",label:"模板描述","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.description))]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"address",label:"门店类型","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[0==t.row.storeType?a("span",[e._v("自营门店")]):e._e(),e._v(" "),1==t.row.storeType?a("span",[e._v("联营门店")]):e._e(),e._v(" "),2==t.row.storeType?a("span",[e._v("代理门店")]):e._e(),e._v(" "),3==t.row.storeType?a("span",[e._v("代销门店")]):e._e(),e._v(" "),4==t.row.storeType?a("span",[e._v("托管门店")]):e._e()]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){e.handlePreview(t.$index,t.row)}}},[e._v("预览")]),e._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){e.handleCopy(t.$index,t.row)}}},[e._v("复制")]),e._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){e.handleEdit(t.$index,t.row)}}},[e._v("编辑")]),e._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){e.handleDelete(t.$index,t.row)}}},[e._v("删除")])]}}])})],1)],1),e._v(" "),a("qrcode-dialog",{ref:"qrcodePreview",model:{value:e.dialogVisible,callback:function(t){e.dialogVisible=t},expression:"dialogVisible"}})],1)},staticRenderFns:[]};var u=a("VU/8")(c,d,!1,function(e){a("sgiw")},"data-v-2dc7d0eb",null);t.default=u.exports},sgiw:function(e,t){}});