webpackJsonp([62],{SCUf:function(t,e){},rUvh:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a("Xxa5"),r=a.n(n),o=a("exGp"),s=a.n(o),c=a("/dO2"),i=a("Ch4/"),l=a("3E4D"),u=a("PI0u"),d=a("P9l9"),p={components:{},props:{brandId:{type:String,default:""}},data:function(){return{activeId:"2",searchInput:"",tableData:[],currentPage:1,pageSize:20,total:0}},watch:{brandId:function(t){t&&this.getTableList()}},methods:{rowDrop:function(){var t=document.querySelector(".el-table__body-wrapper tbody"),e=this;c.default.create(t,{onEnd:function(t){t.newIndex,t.oldIndex;console.log(e.tableData)}})},toDel:function(t,e){var a=this;a.$confirm("是否要删除选中的卡券策略?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){a.delCardList(e.coupCardId)}).catch(function(){})},delCardList:function(t){var e=this,a={gicEnterpriseId:e.brandId,coupCardId:t};Object(d.d)("/haoban-app-customer-web/cardCoupon/del-card-coup",a).then(function(t){var a=t.data;if(1==a.errorCode)return l.a.showmsg("删除成功","success"),void e.getTableList(e.brandId);i.a.errorMsg(a)}).catch(function(t){e.$message.error({duration:1e3,message:t.message})})},toEdit:function(t,e){this.$router.push("/newCardStrategy?coupCardId="+e.coupCardId)},toInput:Object(u.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("/newCardStrategy")},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 s()(r.a.mark(function e(){var a,n;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n={gicEnterpriseId:(a=t).brandId,search:a.searchInput||"",pageNum:a.currentPage,pageSize:a.pageSize},Object(d.d)("/haoban-app-customer-web/cardCoupon/find-card-page",n).then(function(t){var e=t.data;if(1==e.errorCode)return a.tableData=e.result.list||[],void(a.total=e.result.pageInfo.total);i.a.errorMsg(e)}).catch(function(t){a.$message.error({duration:1e3,message:t.message})});case 3:case"end":return e.stop()}},e,t)}))()}},mounted:function(){this.$emit("showTab","1"),document.body.ondrop=function(t){t.preventDefault(),t.stopPropagation()},this.rowDrop(),this.getTableList()}},f={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"},[t._m(0),t._v(" "),t.tableData.length>=5?a("el-button",{attrs:{type:"primary"},on:{click:t.toNewCard}},[t._v("新增策略")]):t._e()],1),t._v(" "),a("el-table",{ref:"multipleTable",staticClass:"select-table",staticStyle:{width:"calc(100% - 3px)"},attrs:{data:t.tableData,"tooltip-effect":"dark"}},[a("el-table-column",{attrs:{prop:"",label:"",width:"100"},scopedSlots:t._u([{key:"default",fn:function(t){return[a("span",{staticClass:"el-icon-s-unfold",staticStyle:{cursor:"move"}})]}}])}),t._v(" "),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.cardName)+"\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.effectDateString||"--"))]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"",label:"状态"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",[t._v(t._s(e.row.couponStock))])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"",label:"操作","show-overflow-tooltip":""},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.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:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",[e("span",{staticClass:"font-14 color-909399 p-l-10"},[this._v("内购券针对企业内部员工发下的卡券，最多新建5个策略")])])}]};var h=a("VU/8")(p,f,!1,function(t){a("SCUf")},"data-v-122762b4",null);e.default=h.exports}});