(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-caf615d4"],{"04a9":function(t,e,n){},"333d":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"pagination-container",class:{hidden:t.hidden}},[n("el-pagination",t._b({attrs:{background:t.background,"current-page":t.currentPage,"page-size":t.pageSize,layout:t.layout,"page-sizes":t.pageSizes,total:t.total},on:{"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e},"update:pageSize":function(e){t.pageSize=e},"update:page-size":function(e){t.pageSize=e},"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}},"el-pagination",t.$attrs,!1))],1)},a=[],i=n("d4ec"),o=n("bee2"),u=n("262e"),c=n("2caf"),s=n("9ab4"),l=n("1b40"),p=(n("4795"),function(t,e,n,r){return t/=r/2,t<1?n/2*t*t+e:(t--,-n/2*(t*(t-2)-1)+e)}),d=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}(),f=function(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t},m=function(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop},b=function(t,e,n){var r=m(),a=t-r,i=20,o=0;e="undefined"===typeof e?500:e;var u=function t(){o+=i;var u=p(o,r,a,e);f(u),o2,a=r?o.call(arguments,2):void 0;return t(r?function(){("function"==typeof e?e:Function(e)).apply(this,a)}:e,n)}};r({global:!0,bind:!0,forced:u},{setTimeout:c(a.setTimeout),setInterval:c(a.setInterval)})},8960:function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"d",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"e",(function(){return u})),n.d(e,"b",(function(){return c}));var r=n("b32d"),a={shop:"",name:"",content:"",total:0,count:0,limitOne:1},i=function(t){return Object(r["a"])({url:"/api/coupons",method:"post",params:t})},o=function(t,e){return Object(r["a"])({url:"/api/coupon/".concat(t),method:"get",params:e})},u=function(t){return Object(r["a"])({url:"/api/coupon/save",method:"post",data:t})},c=function(t){return Object(r["a"])({url:"/api/coupon/".concat(t,"/delete"),method:"post"})}},db85:function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"h",(function(){return i})),n.d(e,"e",(function(){return o})),n.d(e,"d",(function(){return u})),n.d(e,"j",(function(){return c})),n.d(e,"b",(function(){return s})),n.d(e,"k",(function(){return l})),n.d(e,"f",(function(){return p})),n.d(e,"g",(function(){return d})),n.d(e,"m",(function(){return f})),n.d(e,"l",(function(){return m})),n.d(e,"c",(function(){return b})),n.d(e,"i",(function(){return h}));var r=n("b32d"),a={name:"",address:"",logo:"",qtypes:[]},i=function(t){return Object(r["a"])({url:"/api/shops",method:"post",params:t})},o=function(t,e){return Object(r["a"])({url:"/api/shop/".concat(t),method:"get",params:e})},u=function(){return Object(r["a"])({url:"/api/myshop",method:"get"})},c=function(t){return Object(r["a"])({url:"/api/shop/save",method:"post",data:t})},s=function(t){return Object(r["a"])({url:"/api/shop/".concat(t,"/delete"),method:"post"})},l=function(t){return Object(r["a"])({url:"/api/shop/gameinfo/save",method:"post",data:t})},p=function(t){return Object(r["a"])({url:"/api/shop/gameinfo",method:"post",data:t})},d=function(t){return Object(r["a"])({url:"/api/shop/gameqr",method:"post",data:t})},f=function(t){return Object(r["a"])({url:"/api/shop/save_qtype",method:"post",data:t})},m=function(t){return Object(r["a"])({url:"/api/shop/publish",method:"post",data:t})},b=function(t){return Object(r["a"])({url:"/api/shop/gametheme",method:"post",data:t})},h=function(t){return Object(r["a"])({url:"/api/shop/gametheme/save",method:"post",data:t})}},f08f:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-container"},[n("el-form",{ref:"filterForm",staticClass:"filter",attrs:{inline:!0,model:t.filterForm}},[n("el-form-item",{attrs:{label:"关键字",prop:"key"}},[n("el-input",{attrs:{placeholder:"关键字"},model:{value:t.filterForm.key,callback:function(e){t.$set(t.filterForm,"key",e)},expression:"filterForm.key"}})],1),1===t.userLevel?n("el-form-item",{attrs:{label:"店铺"}},[n("el-select",{staticClass:"w100",attrs:{placeholder:"所有"},model:{value:t.filterForm.department,callback:function(e){t.$set(t.filterForm,"department",e)},expression:"filterForm.department"}},[n("el-option",{attrs:{value:""}},[t._v("所有")]),t._l(t.allDepts,(function(t){return n("el-option",{key:t._id,attrs:{label:t.name,value:t._id}})}))],2)],1):t._e(),n("el-form-item",[n("el-button",{attrs:{type:"primary"},on:{click:t.search}},[t._v("查询")]),n("el-button",{on:{click:t.resetFilterForm}},[t._v("重置")])],1)],1),n("router-link",{attrs:{to:"/marketing/edit_coupon"}},[n("el-button",{attrs:{type:"primary",icon:"el-icon-edit"}},[t._v(" 添加 ")])],1),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],staticStyle:{width:"100%","margin-top":"30px"},attrs:{data:t.list,border:"",fit:"",stripe:"","highlight-current-row":""}},[n("el-table-column",{attrs:{width:"180px",align:"center",label:"添加时间"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[n("span",[t._v(t._s(t._f("parseTime")(r.createdAt)))])]}}])}),1===t.userLevel?n("el-table-column",{attrs:{label:"店铺",prop:"shop",formatter:t.formatDept}}):t._e(),n("el-table-column",{attrs:{"min-width":"200px",label:"名称"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[n("router-link",{staticClass:"link-type",attrs:{to:"/marketing/edit_coupon/"+r._id}},[n("span",[t._v(t._s(r.name))])])]}}])}),n("el-table-column",{attrs:{label:"有效期"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[n("span",[t._v(t._s(t._f("parseDate")(r.validBegin)))]),t._v(" 至 "),n("span",[t._v(t._s(t._f("parseDate")(r.validEnd)))])]}}])}),n("el-table-column",{attrs:{label:"库存"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[n("el-tag",[t._v(t._s(t._f("formatCount")(r.count)))]),t._v(" / "),n("el-tag",[t._v(t._s(t._f("formatCount")(r.total)))])]}}])}),n("el-table-column",{attrs:{align:"center",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("router-link",{attrs:{to:"/marketing/edit_coupon/"+e.row._id}},[n("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-edit"}},[t._v(" 编辑 ")])],1),n("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"danger",size:"small"},on:{click:function(n){return t.handleDelete(e)}}},[t._v(" "+t._s(t.$t("permission.delete"))+" ")])]}}])})],1),n("pagination",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total>0"}],attrs:{total:t.total,page:t.listQuery.page,limit:t.listQuery.limit},on:{"update:page":function(e){return t.$set(t.listQuery,"page",e)},"update:limit":function(e){return t.$set(t.listQuery,"limit",e)},pagination:t.getList}})],1)},a=[],i=n("b85c"),o=n("1da1"),u=n("d4ec"),c=n("bee2"),s=n("262e"),l=n("2caf"),p=(n("a434"),n("b0c0"),n("96cf"),n("9ab4")),d=n("1b40"),f=n("333d"),m=n("db85"),b=n("d257"),h=n("8960"),g=n("9dba"),v=function(t){Object(s["a"])(n,t);var e=Object(l["a"])(n);function n(){var t;return Object(u["a"])(this,n),t=e.apply(this,arguments),t.total=0,t.list=[],t.listLoading=!0,t.allDepts=[],t.listQuery={page:1,limit:20,key:"",shop:""},t.filterForm={key:"",department:""},t}return Object(c["a"])(n,[{key:"userLevel",get:function(){return g["a"].level}},{key:"created",value:function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.getList();case 2:if(1!==g["a"].level){t.next=5;break}return t.next=5,this.getRemoteDeptList();case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"getList",value:function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(){var e,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.listLoading=!0,console.log(this.listQuery),t.next=4,Object(h["d"])(this.listQuery);case 4:e=t.sent,n=e.data,this.listLoading=!1,this.list=n.records,this.total=n.total;case 9:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"handleDelete",value:function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(e){var n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=e.$index,r=e.row,t.next=3,this.$confirm("确认删除该优惠券?","Warning",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 3:return t.next=5,Object(h["b"])(r._id);case 5:this.list.splice(n,1),this.$message({type:"success",message:"删除成功!"});case 7:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()},{key:"search",value:function(){this.filterData()}},{key:"filterData",value:function(){this.listQuery.key=this.filterForm.key,this.listQuery.shop=this.filterForm.department,this.listQuery.page=1,this.getList()}},{key:"resetFilterForm",value:function(){this.$refs.filterForm.resetFields()}},{key:"formatDept",value:function(t,e,n,r){var a,o="未指定",u=Object(i["a"])(this.allDepts);try{for(u.s();!(a=u.n()).done;){var c=a.value;if(c._id===n){o=c.name;break}}}catch(s){u.e(s)}finally{u.f()}return o}},{key:"getRemoteDeptList",value:function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(e){var n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(m["h"])({key:e});case 2:if(n=t.sent,r=n.data,r.records){t.next=6;break}return t.abrupt("return");case 6:this.allDepts=r.records;case 7:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()}]),n}(d["c"]);v=Object(p["a"])([Object(d["a"])({name:"CouponList",components:{Pagination:f["a"]},filters:{parseTime:function(t){return Object(b["c"])(t)},parseDate:function(t){return t?Object(b["c"])(t,"{y}-{m}-{d}"):"-"},formatCount:function(t){return t||0}}})],v);var y=v,j=y,O=n("0c7c"),k=Object(O["a"])(j,r,a,!1,null,null,null);e["default"]=k.exports}}]); //# sourceMappingURL=chunk-caf615d4.7c269a2c.js.map