(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-f15720a6"],{1561:function(e,t,a){"use strict";var r=a("f429"),n=a.n(r);n.a},1707:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"outmain ba_f heighthv pad_20 bor_rad5"},[e._m(0),a("div",{staticClass:"flex-bet pad_lr_20"},[a("div",[a("el-button",{attrs:{type:"primary",size:"medium"},on:{click:e.handleEdit}},[e._v("创建活动")])],1),a("div")]),a("div",{staticClass:"tabledata mar_t20"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:e.list,"element-loading-text":e.elementLoadingText,stripe:""}},[a("el-table-column",{attrs:{prop:"name",label:"兑换码名称"}}),a("el-table-column",{attrs:{prop:"time",label:"活动时间",width:"280"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v(e._s(t.row.startTime))]),a("div",[e._v(e._s(t.row.endTime))])]}}])}),a("el-table-column",{attrs:{prop:"couponNum",label:"优惠券数量"}}),a("el-table-column",{attrs:{prop:"stock",label:"已兑换/剩余库存"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(t.row.salesNum)+"/")]),a("span",[e._v(e._s(t.row.stock))])]}}])}),a("el-table-column",{attrs:{prop:"limitType",label:"使用限制"},scopedSlots:e._u([{key:"default",fn:function(t){return["1"==t.row.limitType?a("div",[e._v("不限制")]):a("div",[e._v("每人可用 "+e._s(t.row.maxNum)+" 个")])]}}])}),a("el-table-column",{attrs:{prop:"display",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-switch",{attrs:{"active-value":"1","inactive-value":"2"},on:{change:function(a){return e.changeSwitch(t.row)}},model:{value:t.row.display,callback:function(a){e.$set(t.row,"display",a)},expression:"scope.row.display"}})]}}])}),a("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"flex"},[a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleEdit(t.row)}}},[e._v("编辑")]),a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleList(t.row)}}},[e._v("兑换码列表")]),a("el-button",{attrs:{type:"text"}},[a("a",{attrs:{href:e.handelExport(t.row)}},[e._v("导出")])]),a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleDelete(t.row)}}},[e._v("删除")])],1)]}}])})],1),a("el-pagination",{attrs:{background:"",layout:"prev, pager, next",total:e.page.total,"page-size":e.page.pagesize,"current-page":e.page.currentPage},on:{"update:currentPage":function(t){return e.$set(e.page,"currentPage",t)},"update:current-page":function(t){return e.$set(e.page,"currentPage",t)},"current-change":e.handleCurrentChange}}),a("edit",{ref:"edit",on:{fetchData:e.fetchData}})],1)])},n=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"shuju_title mar_b20"},[a("div",{staticClass:"shuju_title_text"},[a("span",[e._v("兑换码")])])])}],s=(a("d81d"),a("96cf"),a("1da1")),i=a("5530"),o=a("7cb7"),c=a("4e63"),l=a("365c"),u=a("2f62"),d={components:{Edit:c["a"]},created:function(){this.fetchData()},computed:Object(i["a"])({},Object(u["d"])(["storeId"])),data:function(){return{list:[],listLoading:!1,selectRows:"",elementLoadingText:"正在加载...",page:{total:0,size:10,currentPage:1}}},methods:{fetchData:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var a,r,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.listLoading=!0,t.next=3,Object(o["v"])({page:e.page.currentPage,storeId:e.storeId});case 3:a=t.sent,r=a.data,n=a.count,e.list=r,e.page.total=n,e.listLoading=!1;case 9:case"end":return t.stop()}}),t)})))()},handleCurrentChange:function(e){this.page.currentPage=e,this.fetchData()},handleList:function(e){e.id?this.$refs["edit"].showEdit(e):this.$refs["edit"].showEdit()},changeSwitch:function(e){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function a(){var r,n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(o["wb"])({id:e.id,display:e.display,type:1,storeId:t.storeId});case 2:r=a.sent,n=r.msg,t.$baseMessage(n,"success"),t.fetchData();case 6:case"end":return a.stop()}}),a)})))()},handelExport:function(e){var t=l["a"].backendPath;return t+"channel/activity/exchange-code-export?id="+e.id},handleDelete:function(e){var t=this;if(e.id)this.$baseConfirm("你确定要删除当前项吗",null,Object(s["a"])(regeneratorRuntime.mark((function a(){var r,n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(o["wb"])({id:e.id,type:2,storeId:t.storeId});case 2:r=a.sent,n=r.msg,t.$baseMessage(n,"success"),t.fetchData();case 6:case"end":return a.stop()}}),a)}))));else{if(!(this.selectRows.length>0))return this.$baseMessage("未选中任何行","error"),!1;var a=this.selectRows.map((function(e){return e.id}));this.$baseConfirm("你确定要删除选中项吗",null,Object(s["a"])(regeneratorRuntime.mark((function e(){var r,n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(o["wb"])({id:a,type:2,storeId:t.storeId});case 2:r=e.sent,n=r.msg,t.$baseMessage(n,"success"),t.fetchData();case 6:case"end":return e.stop()}}),e)}))))}},handleEdit:function(e){e.id?this.$router.push("/storeexchangeadd?id=".concat(e.id)):this.$router.push({path:"storeexchangeadd"})}}},p=d,g=a("2877"),f=Object(g["a"])(p,r,n,!1,null,null,null);t["default"]=f.exports},"4e63":function(e,t,a){"use strict";var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{},[a("el-dialog",{attrs:{title:e.title,visible:e.dialogFormVisible,width:"900px","close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogFormVisible=t},close:e.close}},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.list,stripe:""}},[a("el-table-column",{attrs:{prop:"code",label:"兑换码名称"}}),a("el-table-column",{attrs:{prop:"state",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{directives:[{name:"show",rawName:"v-show",value:"1"==t.row.state,expression:"scope.row.state=='1'"}],staticClass:"color-red"},[e._v("已兑换")]),a("div",{directives:[{name:"show",rawName:"v-show",value:"2"==t.row.state,expression:"scope.row.state=='2'"}],staticClass:"color_9"},[e._v("未兑换")])]}}])}),a("el-table-column",{attrs:{prop:"changeAt",label:"兑换时间"}}),a("el-table-column",{attrs:{prop:"changeAt",label:"兑换人信息"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.userName?a("div",{staticClass:"flex flex-y-top"},[a("div",{},[a("img",{staticClass:"goodlogo bor_rad50",attrs:{src:t.row.portrait}})]),a("div",{staticClass:"mar_l10"},[a("div",{},[a("div",{},[e._v(e._s(t.row.userName))]),a("el-tag",{attrs:{size:"mini",type:"info"}},[e._v("(Id:"+e._s(t.row.userId)+")")])],1)])]):e._e()]}}])})],1),a("el-pagination",{attrs:{background:"",layout:"prev, pager, next",total:e.page.total,"page-size":e.page.pagesize,"current-page":e.page.currentPage},on:{"update:currentPage":function(t){return e.$set(e.page,"currentPage",t)},"update:current-page":function(t){return e.$set(e.page,"currentPage",t)},"current-change":e.handleCurrentChange}}),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"medium"},on:{click:e.close}},[e._v("取 消")]),a("el-button",{attrs:{size:"medium",type:"primary"},on:{click:e.close}},[e._v("确 定")])],1)],1)],1)},n=[],s=(a("96cf"),a("1da1")),i=a("7cb7"),o={name:"labelSave",created:function(){},data:function(){return{form:{id:"",name:"",sort:"1",color:"#ed4014"},list:[],page:{total:0,size:20,currentPage:1},title:"",dialogFormVisible:!1}},components:{},methods:{showEdit:function(e){e?(this.title="兑换码列表",this.form=Object.assign({},e)):this.title="添加",this.codeList(),this.dialogFormVisible=!0},close:function(){this.dialogFormVisible=!1},codeList:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var a,r,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(i["k"])({id:e.form.id,page:e.page.currentPage});case 2:a=t.sent,r=a.data,n=a.count,e.list=r,e.page.total=n;case 7:case"end":return t.stop()}}),t)})))()},handleCurrentChange:function(e){this.page.currentPage=e,this.codeList()}}},c=o,l=(a("1561"),a("2877")),u=Object(l["a"])(c,r,n,!1,null,null,null);t["a"]=u.exports},f429:function(e,t,a){}}]);