You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
9.0 KiB
1 lines
9.0 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-7ac4234a"],{"0b65":function(t,e,a){"use strict";e.a={shortcuts:[{text:"今天",value:function(){var t=new Date,e=new Date;return e.setTime(new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate())),[e,t]}},{text:"昨天",value:function(){var t=new Date,e=new Date;return e.setTime(e.setTime(new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()-1))),t.setTime(t.setTime(new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()-1))),[e,t]}},{text:"最近7天",value:function(){var t=new Date,e=new Date;return e.setTime(e.setTime(new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()-6))),[e,t]}},{text:"最近30天",value:function(){var t=new Date,e=new Date;return e.setTime(e.setTime(new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()-29))),[e,t]}},{text:"上月",value:function(){var t=new Date,e=new Date,a=new Date(e.getFullYear(),e.getMonth(),0).getDate();return e.setTime(e.setTime(new Date((new Date).getFullYear(),(new Date).getMonth()-1,1))),t.setTime(t.setTime(new Date((new Date).getFullYear(),(new Date).getMonth()-1,a))),[e,t]}},{text:"本月",value:function(){var t=new Date,e=new Date;return e.setTime(e.setTime(new Date((new Date).getFullYear(),(new Date).getMonth(),1))),[e,t]}},{text:"本年",value:function(){var t=new Date,e=new Date;return e.setTime(e.setTime(new Date((new Date).getFullYear(),0,1))),[e,t]}}]}},"6d4b":function(t,e,a){},f3b2:function(t,e,a){"use strict";a.r(e);var i=a("2f62"),n=a("b7be"),r=a("0b65"),s=a("d708");function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,i)}return a}function u(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?l(Object(a),!0).forEach((function(e){c(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function c(t,e,a){return(e=function(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var m={data:function(){return{roterPre:s.a.roterPre,options:r.a,timeVal:[],dataTimeVal:[],formValidate:{name:"",status:"",time:"",create_time:"",page:1,limit:15},list:[{status:0,title:"未开始"},{status:1,title:"进行中"},{status:-1,title:"已结束"}],columns:[{title:"ID",key:"id",width:80},{title:"活动名称",key:"name",minWidth:170},{title:"活动时间",slot:"time",minWidth:260},{title:"参与商品数",key:"product_count",minWidth:100},{title:"活动状态",slot:"start_status",minWidth:100},{title:"是否开启",slot:"status",minWidth:100},{title:"创建时间",key:"add_time",minWidth:140},{title:"操作",slot:"action",minWidth:110,fixed:"right"}],dataList:[],loading:!1,total:0}},computed:u(u({},Object(i.e)("admin/layout",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:96},labelPosition:function(){return this.isMobile?"top":"right"}}),created:function(){this.activityFrameList()},methods:{createTime:function(t){this.timeVal=t,this.formValidate.create_time=this.timeVal.join("-"),this.selChange()},dataTime:function(t){this.dataTimeVal=t,this.formValidate.time=this.dataTimeVal.join("-"),this.selChange()},del:function(t,e,a){var i=this,n={title:e,num:a,url:"marketing/activity_background/del/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(n).then((function(t){i.$Message.success(t.msg),i.dataList.splice(a,1),i.dataList.length||(i.formValidate.page=1==i.formValidate.page?1:i.formValidate.page-1),i.activityFrameList()})).catch((function(t){i.$Message.error(t.msg)}))},onchangeIsShow:function(t){var e=this;Object(n.d)(t.id,t.status).then((function(t){e.$Message.success(t.msg),e.activityFrameList()})).catch((function(t){e.$Message.error(t.msg)}))},edit:function(t){this.$router.push({path:this.roterPre+"/marketing/activity_background/create/"+t})},add:function(){this.$router.push({path:this.roterPre+"/marketing/activity_background/create/0"})},activityFrameList:function(){var t=this;Object(n.b)(this.formValidate).then((function(e){t.dataList=e.data.list,t.total=e.data.count}))},pageChange:function(t){this.formValidate.page=t,this.activityFrameList()},selChange:function(){this.formValidate.page=1,this.activityFrameList()},reset:function(){this.formValidate={name:"",status:"",time:"",create_time:"",page:1,limit:15},this.timeVal=[],this.dataTimeVal=[],this.activityFrameList()}}},d=(a("f824"),a("2877")),f=Object(d.a)(m,(function(){var t=this,e=t._self._c;return e("div",[e("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":"",padding:0}},[e("div",{staticClass:"new_card_pd"},[e("Form",{ref:"formValidate",attrs:{inline:"",model:t.formValidate,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[e("FormItem",{attrs:{label:"活动搜索:"}},[e("Input",{staticClass:"input-width",attrs:{placeholder:"请输入活动名称/ID"},model:{value:t.formValidate.name,callback:function(e){t.$set(t.formValidate,"name",e)},expression:"formValidate.name"}})],1),e("FormItem",{attrs:{label:"活动状态:"}},[e("Select",{staticClass:"input-add",attrs:{clearable:""},on:{"on-change":t.selChange},model:{value:t.formValidate.status,callback:function(e){t.$set(t.formValidate,"status",e)},expression:"formValidate.status"}},t._l(t.list,(function(a,i){return e("Option",{key:i,attrs:{value:a.status}},[t._v(t._s(a.title))])})),1)],1),e("FormItem",{attrs:{label:"活动时间:"}},[e("DatePicker",{staticClass:"input-add",attrs:{editable:!1,value:t.dataTimeVal,format:"yyyy/MM/dd",type:"datetimerange",placement:"bottom-start",placeholder:"活动时间",options:t.options},on:{"on-change":t.dataTime}})],1),e("div",{staticStyle:{display:"inline-block"}},[e("FormItem",{attrs:{label:"创建时间:"}},[e("DatePicker",{staticClass:"input-add",attrs:{editable:!1,value:t.timeVal,format:"yyyy/MM/dd",type:"datetimerange",placement:"bottom-start",placeholder:"创建时间",options:t.options},on:{"on-change":t.createTime}})],1),e("Button",{staticClass:"mr14 mt1",attrs:{type:"primary"},on:{click:t.selChange}},[t._v("查询")]),e("Button",{staticClass:"mt1",on:{click:function(e){return t.reset()}}},[t._v("重置")])],1)],1)],1)]),e("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[e("Button",{directives:[{name:"auth",rawName:"v-auth",value:["marketing-store_seckill-create"],expression:"['marketing-store_seckill-create']"}],staticClass:"mr10",attrs:{type:"primary"},on:{click:t.add}},[t._v("添加活动背景")]),e("Table",{ref:"table",staticClass:"ivu-mt",attrs:{columns:t.columns,data:t.dataList,loading:t.loading,"no-data-text":"暂无数据","no-filtered-data-text":"暂无筛选结果"},scopedSlots:t._u([{key:"time",fn:function(a){var i=a.row;return a.index,[e("div",[t._v(t._s(i.start_time)+" 至 "+t._s(i.stop_time))])]}},{key:"start_status",fn:function(a){var i=a.row;return a.index,[e("Tag",{directives:[{name:"show",rawName:"v-show",value:0===i.start_status,expression:"row.start_status === 0"}],attrs:{color:"red",size:"medium"}},[t._v("未开始")]),e("Tag",{directives:[{name:"show",rawName:"v-show",value:1===i.start_status,expression:"row.start_status === 1"}],attrs:{color:"green",size:"medium"}},[t._v("进行中")]),e("Tag",{directives:[{name:"show",rawName:"v-show",value:-1===i.start_status,expression:"row.start_status === -1"}],attrs:{color:"default",size:"medium"}},[t._v("已结束")])]}},{key:"status",fn:function(a){var i=a.row;return a.index,[e("i-switch",{attrs:{"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.onchangeIsShow(i)}},model:{value:i.status,callback:function(e){t.$set(i,"status",e)},expression:"row.status"}},[e("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),e("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])])]}},{key:"action",fn:function(a){var i=a.row,n=a.index;return[e("a",{on:{click:function(e){return t.edit(i.id)}}},[t._v("编辑")]),e("Divider",{attrs:{type:"vertical"}}),e("a",{on:{click:function(e){return t.del(i,"删除活动背景",n)}}},[t._v("删除")])]}}])}),e("div",{staticClass:"acea-row row-right page"},[e("Page",{attrs:{total:t.total,current:t.formValidate.page,"show-elevator":"","show-total":"","page-size":t.formValidate.limit},on:{"on-change":t.pageChange}})],1)],1)],1)}),[],!1,null,"4c6f4d57",null);e.default=f.exports},f824:function(t,e,a){"use strict";a("6d4b")}}]); |