(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2fec57df"],{"3bbe":function(t,e,r){var n=r("861d");t.exports=function(t){if(!n(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},7156:function(t,e,r){var n=r("861d"),a=r("d2bb");t.exports=function(t,e,r){var o,i;return a&&"function"==typeof(o=e.constructor)&&o!==r&&n(i=o.prototype)&&i!==r.prototype&&a(t,i),t}},a9e3:function(t,e,r){"use strict";var n=r("83ab"),a=r("da84"),o=r("94ca"),i=r("6eeb"),s=r("5135"),c=r("c6b6"),l=r("7156"),u=r("c04e"),f=r("d039"),d=r("7c73"),p=r("241c").f,g=r("06cf").f,m=r("9bf2").f,h=r("58a8").trim,b="Number",v=a[b],w=v.prototype,y=c(d(w))==b,_=function(t){var e,r,n,a,o,i,s,c,l=u(t,!1);if("string"==typeof l&&l.length>2)if(l=h(l),e=l.charCodeAt(0),43===e||45===e){if(r=l.charCodeAt(2),88===r||120===r)return NaN}else if(48===e){switch(l.charCodeAt(1)){case 66:case 98:n=2,a=49;break;case 79:case 111:n=8,a=55;break;default:return+l}for(o=l.slice(2),i=o.length,s=0;sa)return NaN;return parseInt(o,n)}return+l};if(o(b,!v(" 0o1")||!v("0b1")||v("+0x1"))){for(var x,D=function(t){var e=arguments.length<1?0:t,r=this;return r instanceof D&&(y?f((function(){w.valueOf.call(r)})):c(r)!=b)?l(new v(_(e)),r,D):_(e)},k=n?p(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),O=0;k.length>O;O++)s(v,x=k[O])&&!s(D,x)&&m(D,x,g(v,x));D.prototype=w,w.constructor=D,i(a,b,D)}},bf19:function(t,e,r){"use strict";var n=r("23e7");n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}})},d2bb:function(t,e,r){var n=r("825a"),a=r("3bbe");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,t.call(r,[]),e=r instanceof Array}catch(o){}return function(r,o){return n(r),a(o),e?t.call(r,o):r.__proto__=o,r}}():void 0)},ed08:function(t,e,r){"use strict";r.d(e,"a",(function(){return n})),r.d(e,"b",(function(){return a})),r.d(e,"c",(function(){return o}));r("a9e3"),r("ac1f"),r("5319"),r("bf19");function n(t){var e=new Date(t).toJSON(),r=new Date(+new Date(e)+288e5).toISOString().replace(/T/g," ").replace(/\.[\d]{3}Z/,"");return r}function a(t){var e=new Date(t),r=e.getFullYear(),n=e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1,a=e.getDate()<10?"0"+e.getDate():e.getDate(),o=e.getHours()<10?"0"+e.getHours():e.getHours(),i=e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes(),s=e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds();return r+"-"+n+"-"+a+" "+o+":"+i+":"+s}function o(t){var e=new Date(1e3*Number(t)),r=e.getFullYear()+"-",n=(e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1)+"-",a=(e.getDate()<10?"0"+e.getDate():e.getDate())+" ",o=(e.getHours()<10?"0"+e.getHours():e.getHours())+":",i=(e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes())+":",s=e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds(),c=r+n+a+o+i+s;return c}},ef59:function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"outmain ba_f"},[r("div",{staticClass:"maintitle"},[t._v("门店活动")]),r("el-button",{staticClass:"mar_t20",attrs:{type:"primary",size:"medium"},on:{click:t.handleEdit}},[t._v("新增活动")]),r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{"element-loading-text":t.elementLoadingText,data:t.list,"tooltip-effect":"dark"},on:{"selection-change":t.setSelectRows}},[r("el-table-column",{attrs:{type:"selection",width:"55"}}),r("el-table-column",{attrs:{prop:"type",label:"活动类型"}}),r("el-table-column",{attrs:{prop:"startTime",label:"活动时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.startTime?r("div",[t._v(t._s(e.row.startTime.substring(0,10))+"-"+t._s(e.row.endTime.substring(0,10)))]):t._e()]}}])}),r("el-table-column",{attrs:{prop:"details",label:"活动规则"}}),r("el-table-column",{attrs:{prop:"display",label:"状态"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("el-switch",{attrs:{"active-value":"1","inactive-value":"2"},on:{change:function(r){return t.changeSwitch(e.row)}},model:{value:e.row.display,callback:function(r){t.$set(e.row,"display",r)},expression:"scope.row.display"}})]}}])}),r("el-table-column",{attrs:{label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("el-button",{attrs:{type:"text"},on:{click:function(r){return t.handleEdit(e.row)}}},[t._v("编辑 ")]),r("el-button",{attrs:{type:"text"},on:{click:function(r){return t.handleDelete(e.row)}}},[t._v("删除 ")])]}}])})],1),r("el-pagination",{attrs:{background:"",layout:"prev, pager, next",total:t.page.total,"page-size":t.page.pagesize,"current-page":t.page.currentPage},on:{"update:currentPage":function(e){return t.$set(t.page,"currentPage",e)},"update:current-page":function(e){return t.$set(t.page,"currentPage",e)},"current-change":t.handleCurrentChange}}),r("edit",{ref:"edit",on:{fetchData:t.fetchData}})],1)},a=[],o=(r("d81d"),r("96cf"),r("1da1")),i=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{},[r("el-dialog",{attrs:{title:t.title,visible:t.dialogFormVisible,width:"600px"},on:{"update:visible":function(e){t.dialogFormVisible=e},close:t.close}},[r("el-form",{ref:"form",attrs:{model:t.form,"label-width":"120px"}},[r("el-form-item",{attrs:{label:"排序"}},[r("el-input",{attrs:{autocomplete:"off",type:"number"},model:{value:t.form.sort,callback:function(e){t.$set(t.form,"sort","string"===typeof e?e.trim():e)},expression:"form.sort"}})],1),r("el-form-item",{attrs:{label:"活动类型"}},[r("el-input",{attrs:{autocomplete:"off"},model:{value:t.form.type,callback:function(e){t.$set(t.form,"type","string"===typeof e?e.trim():e)},expression:"form.type"}})],1),r("el-form-item",{attrs:{label:"活动时间"}},[r("el-date-picker",{staticStyle:{width:"300px"},attrs:{type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},model:{value:t.timeData,callback:function(e){t.timeData=e},expression:"timeData"}})],1),r("el-form-item",{attrs:{label:"活动规则"}},[r("el-input",{attrs:{autocomplete:"off"},model:{value:t.form.details,callback:function(e){t.$set(t.form,"details","string"===typeof e?e.trim():e)},expression:"form.details"}})],1)],1),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{attrs:{size:"medium"},on:{click:t.close}},[t._v("取 消")]),r("el-button",{attrs:{size:"medium",type:"primary"},on:{click:t.save}},[t._v("确 定")])],1)],1)],1)},s=[],c=r("b775");function l(t){return Object(c["a"])({url:"channel/shop/get-activity-list",method:"get",params:t})}function u(t){return Object(c["a"])({url:"channel/shop/activity-save",method:"post",data:t})}function f(t){return Object(c["a"])({url:"channel/shop/change-activity",method:"post",data:t})}function d(t){return Object(c["a"])({url:"channel/shop/activity-del",method:"post",data:t})}var p=r("ed08"),g={name:"goodlistedit",created:function(){},data:function(){return{form:{details:"",sort:"",type:""},timeData:[],content:"",title:"",dialogFormVisible:!1}},methods:{showEdit:function(t){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:t?(e.title="编辑",e.form=Object.assign({},t)):e.title="添加",e.dialogFormVisible=!0;case 2:case"end":return r.stop()}}),r)})))()},close:function(){this.$refs["form"].resetFields(),this.form=this.$options.data().form,this.dialogFormVisible=!1},save:function(){var t=this;this.$refs["form"].validate(function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(r){var n,a,o,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!r){e.next=11;break}return t.timeData&&(n=Object(p["a"])(t.timeData[0]),a=Object(p["a"])(t.timeData[1]),t.form.startTime=n,t.form.endTime=a),e.next=4,u(t.form);case 4:o=e.sent,i=o.msg,t.$baseMessage(i,"success"),t.$emit("fetchData"),t.close(),e.next=12;break;case 11:return e.abrupt("return",!1);case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}}},m=g,h=r("2877"),b=Object(h["a"])(m,i,s,!1,null,null,null),v=b.exports,w={components:{Edit:v},created:function(){this.fetchData()},data:function(){return{list:[],listLoading:!0,selectRows:"",elementLoadingText:"正在加载...",page:{total:0,size:10,currentPage:1}}},methods:{fetchData:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){var r,n,a,o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.listLoading=!0,r={page:t.page.currentPage},e.next=4,l(r);case 4:n=e.sent,a=n.data,o=n.count,t.list=a,t.page.total=o,t.listLoading=!1;case 10:case"end":return e.stop()}}),e)})))()},handleEdit:function(t){t.id?this.$refs["edit"].showEdit(t):this.$refs["edit"].showEdit()},setSelectRows:function(t){this.selectRows=t},handleCurrentChange:function(t){this.page.currentPage=t,this.fetchData()},changeSwitch:function(t){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function r(){var n,a;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,f({id:t.id,display:t.display});case 2:n=r.sent,a=n.msg,e.$baseMessage(a,"success"),e.fetchData();case 6:case"end":return r.stop()}}),r)})))()},handleDelete:function(t){var e=this;if(t.id)this.$baseConfirm("你确定要删除当前项吗",null,Object(o["a"])(regeneratorRuntime.mark((function r(){var n,a;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,d({id:t.id});case 2:n=r.sent,a=n.msg,e.$baseMessage(a,"success"),e.fetchData();case 6:case"end":return r.stop()}}),r)}))));else{if(!(this.selectRows.length>0))return this.$baseMessage("未选中任何行","error"),!1;var r=this.selectRows.map((function(t){return t.id}));this.$baseConfirm("你确定要删除选中项吗",null,Object(o["a"])(regeneratorRuntime.mark((function t(){var n,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,d({id:r});case 2:n=t.sent,a=n.msg,e.$baseMessage(a,"success"),e.fetchData();case 6:case"end":return t.stop()}}),t)}))))}}}},y=w,_=Object(h["a"])(y,n,a,!1,null,null,null);e["default"]=_.exports}}]);