webpackJsonp([50],{l5zA:function(e,t,a){var r=a("q/Nl");"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);a("rjj0")("66b58354",r,!1,{})},"q/Nl":function(e,t,a){(e.exports=a("FZ+f")(!0)).push([e.i,"\n.orderCount[data-v-7869a9e3] {\n  padding: 10px;\n}\n","",{version:3,sources:["/Users/xiaxue/Desktop/admin/src/components/orderCount/monthOrderCount.vue"],names:[],mappings:";AACA;EACE,cAAc;CACf",file:"monthOrderCount.vue",sourcesContent:["\n.orderCount[data-v-7869a9e3] {\n  padding: 10px;\n}\n"],sourceRoot:""}])},"v/LD":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("CCn6"),n=a("+TkF"),o={name:"monthOrderCount",data:function(){var e=this;return{goodsList:[],headList:[],today:{text:"今天",onClick:function(t){t.$emit("pick",[e.formatTime(new Date),e.formatTime(new Date)])}},yesterday:{text:"昨天",onClick:function(t){var a=e.formatTime(new Date((new Date).getTime()-864e5));t.$emit("pick",[a,a])}},last7Day:{text:"过去7天",onClick:function(t){var a=e.formatTime(new Date((new Date).getTime()-6048e5));t.$emit("pick",[a,e.formatTime(new Date)])}},last30Day:{text:"过去30天",onClick:function(t){var a=e.formatTime(new Date((new Date).getTime()-2592e6));t.$emit("pick",[a,e.formatTime(new Date)])}},tableData:[],searchFrom:{priceList:[],dateValue:[]}}},mounted:function(){this.defaultTime(),this.initPage()},filters:{toFixed2:function(e){if("number"==typeof e){var t=e.toString().split(".");return t.length>1&&t[1].length>2?Number(e).toFixed(2):e}return e},filterGoods:function(e){return"["+e.id+"]["+n.k[e.goods_type]+"]["+e.current_price/100+"元]"+e.name}},methods:{formatTime:function(e){var t=e.getFullYear(),a=e.getMonth()+1;a<10&&(a="0"+a);var r=e.getDate();return r<10&&(r="0"+r),t+"-"+a+"-"+r},defaultTime:function(){var e=new Date,t=e.getFullYear(),a=e.getMonth()+1;a<10&&(a="0"+a);var r=e.getDate();r<10&&(r="0"+r);var n=t+"-"+a+"-01",o=t+"-"+a+"-"+r;this.searchFrom.dateValue=[n,o]},initPage:function(){var e=this;Object(r._70)({limit:99999,course_type:0,status:"1,2"}).then(function(t){t.list.forEach(function(t){e.searchFrom.priceList.push(t.id)}),e.goodsList=t.list,e.searchPage()})},searchPage:function(){var e=this;if(console.log(this.searchFrom.dateValue),this.searchFrom.dateValue.length<2)this.$message.error("请先选择起止日期");else{var t={start_at:this.searchFrom.dateValue[0],end_at:this.searchFrom.dateValue[1],goods_ids:this.searchFrom.priceList.toString()};Object(r._158)(t).then(function(t){if(t.length>0){var a=t[0];for(var r in e.tableData=t,e.headList=[],a)"cur_date"===r?e.headList.push("时间"):"register_num"===r?e.headList.push("注册数"):"total_money"===r?e.headList.push("总金额"):e.headList.push(r)}})}}}},i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"orderCount"},[a("el-form",{ref:"searchFrom",attrs:{inline:"",model:e.searchFrom,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"商品"}},[a("el-select",{staticStyle:{width:"600px"},attrs:{"collapse-tags":"",multiple:"",filterable:"",placeholder:"请选择"},on:{change:e.searchPage},model:{value:e.searchFrom.priceList,callback:function(t){e.$set(e.searchFrom,"priceList",t)},expression:"searchFrom.priceList"}},e._l(e.goodsList,function(t){return a("el-option",{key:t.id,attrs:{label:e._f("filterGoods")(t),value:t.id}})}))],1),e._v(" "),a("el-form-item",{attrs:{label:"起止日期"}},[a("el-date-picker",{attrs:{"unlink-panels":"",type:"daterange","picker-options":{shortcuts:[e.today,e.yesterday,e.last7Day,e.last30Day]},"value-format":"yyyy-MM-dd","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},on:{change:e.searchPage},model:{value:e.searchFrom.dateValue,callback:function(t){e.$set(e.searchFrom,"dateValue",t)},expression:"searchFrom.dateValue"}})],1),e._v(" "),a("el-form-item",{attrs:{label:""}},[a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.searchPage()}}},[e._v("\n        搜索\n      ")])],1)],1),e._v(" "),a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData}},e._l(e.headList,function(t){return a("el-table-column",{key:t,attrs:{label:t},scopedSlots:e._u([{key:"default",fn:function(r){return["时间"===t?a("span",[e._v("\n        "+e._s(r.row.cur_date)+"\n        ")]):e._e(),e._v(" "),"注册数"===t?a("span",[e._v("\n        "+e._s(r.row.register_num)+"\n        ")]):e._e(),e._v(" "),"总金额"===t?a("span",[e._v("\n        "+e._s(r.row.total_money)+"\n        ")]):e._e(),e._v(" "),"时间"!==t&&"注册数"!==t&&"总金额"!==t?a("span",[e._v("\n        "+e._s(e._f("toFixed2")(r.row[t]))+"\n        ")]):e._e()]}}])})}))],1)};i._withStripped=!0;var s={render:i,staticRenderFns:[]},l=s;var c=!1;var u=a("VU/8")(o,l,!1,function(e){c||a("l5zA")},"data-v-7869a9e3",null);u.options.__file="src/components/orderCount/monthOrderCount.vue";t.default=u.exports}});