webpackJsonp([43],{c7iB:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a("Xxa5"),r=a.n(n),s=a("exGp"),o=a.n(s),i=a("Ch4/"),l=a("3E4D"),c=a("PI0u"),u=a("P9l9"),p={components:{},props:{brandId:{type:String,default:""}},data:function(){return{activeId:"2",wxEnterpriseId:localStorage.getItem("userInfos")?JSON.parse(localStorage.getItem("userInfos")).wxEnterpriseId:"",searchInput:"",loading:!1,tableData:[],currentPage:1,pageSize:20,total:0}},watch:{brandId:function(t){t&&this.getTableList()}},methods:{toDel:function(t,e){var a=this;a.$confirm("是否要删除选中的卡券模板?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){a.delCardList(e.templateId)}).catch(function(){})},delCardList:function(t){var e=this,a={templateId:t};Object(u.d)("/haoban-app-customer-web/inner/delete-template",a).then(function(t){var a=t.data;if(1==a.errorCode)return l.a.showmsg("删除成功","success"),void e.getTableList();i.a.errorMsg(a)}).catch(function(t){e.$message.error({duration:1e3,message:t.message})})},toEdit:function(t,e){this.$router.push("/newCardTemp?templateId="+e.templateId)},toInput:Object(c.a)(function(t,e){this.currentPage=1,this.getTableList(this.brandId)},500),clearInput:function(){this.currentPage=1,this.getTableList(this.brandId)},toNewCard:function(){this.$router.push("/newCardTemp")},handleSizeChange:function(t){this.pageSize=t,this.getTableList()},handleCurrentChange:function(t){this.currentPage=t,this.getTableList()},changeYear:function(){this.currentPage=1,this.getTableList()},getTableList:function(){var t=this;return o()(r.a.mark(function e(){var a,n;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:(a=t).loading=!0,n={wxEnterpriseId:a.wxEnterpriseId,search:a.searchInput||""},Object(u.d)("/haoban-app-customer-web/inner/list-template",n).then(function(t){var e=t.data;if(a.loading=!1,1==e.errorCode)return a.tableData=e.result||[],void(!a.searchInput&&e.result&&e.result.length&&(a.total=e.result.length));i.a.errorMsg(e)}).catch(function(t){a.loading=!1,a.$message.error({duration:1e3,message:t.message})});case 4:case"end":return e.stop()}},e,t)}))()}},mounted:function(){this.$emit("showTab","1"),this.getTableList()}},d={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("section",{staticClass:"common-right-wrap"},[a("div",{staticClass:"p-20"},[a("div",{staticClass:"flex flex-space-between m-b-20"},[a("div",[a("el-input",{staticClass:"w-264",staticStyle:{width:"264px"},attrs:{placeholder:"请输入模板名称",clearable:""},on:{clear:t.clearInput},nativeOn:{keyup:function(e){return a=e,t.toInput(a,t.searchInput);var a}},model:{value:t.searchInput,callback:function(e){t.searchInput=e},expression:"searchInput"}},[a("i",{staticClass:"el-input__icon el-icon-search",attrs:{slot:"prefix"},slot:"prefix"})]),t._v(" "),a("span",{staticClass:"font-12 color-909399 p-l-10 font-w-300"},[t._v("内购券是选取GIC中针对企业内部员工发下的，最多创建20个模板")])],1),t._v(" "),a("el-button",{attrs:{disabled:t.total>=20,type:"primary"},on:{click:t.toNewCard}},[t._v("新增模板")])],1),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"multipleTable",staticClass:"select-table",staticStyle:{width:"calc(100% - 0px)"},attrs:{data:t.tableData,"tooltip-effect":"dark"}},[a("el-table-column",{attrs:{prop:"",label:"卡券模板名称","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n          "+t._s(e.row.templateName)+"\n        ")]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"",label:"卡券类型"},scopedSlots:t._u([{key:"default",fn:function(e){return[0==e.row.cardType?a("span",[t._v("抵金券")]):t._e(),t._v(" "),1==e.row.cardType?a("span",[t._v("折扣券")]):t._e()]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"",label:"提交人","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.commitName||"--"))]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"",label:"最近编辑时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"color-606266 line-18"},[t._v(t._s(t._f("timeStampToYmd")(e.row.updateTime)))]),t._v(" "),a("div",{staticClass:"color-606266 line-18"},[t._v(t._s(t._f("timeStampToHms")(e.row.updateTime)))])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text"},on:{click:function(a){t.toEdit(e.$index,e.row)}}},[t._v("编辑")]),t._v(" "),a("el-button",{attrs:{type:"text"},on:{click:function(a){t.toDel(e.$index,e.row)}}},[t._v("删除")])]}}])})],1)],1)])},staticRenderFns:[]};var f=a("VU/8")(p,d,!1,function(t){a("op/X")},"data-v-6e124adc",null);e.default=f.exports},"op/X":function(t,e){}});