(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-690e8ad9"],{7443:function(e,t,n){"use strict";n("f2ad")},a5e4:function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e._self._c;return t("div",{staticClass:"shop-list"},[t("x-crud",{on:{load:e.onLoad},scopedSlots:e._u([{key:"slot-date-select",fn:function(){return[t("el-date-picker",{attrs:{type:"daterange",align:"right","unlink-panels":"","range-separator":"至","start-placeholder":"开始日期","value-format":"yyyy-MM-dd","end-placeholder":"结束日期","picker-options":e.pickerOptions,size:"mini"},on:{change:e.getDate},model:{value:e.currentDateList,callback:function(t){e.currentDateList=t},expression:"currentDateList"}})]},proxy:!0},{key:"slot-export-due",fn:function(){return[t("el-button",{staticStyle:{"margin-left":"60px"},attrs:{type:"primary",size:"mini"},on:{click:function(t){return e.exportData()}}},[e._v("导出数据")])]},proxy:!0},{key:"slot-class-tip",fn:function(){return[t("div",{staticClass:"class-tip"},[e._v(" 采购成本、销售收入已按售后扣减(隔天售后记在通过日,分类成本/收入可为负)。采购仅退款、销售仅退款含隔天通过日金额。 ")])]},proxy:!0},{key:"table-column-income",fn:function({scope:n}){return[t("div",{style:e.negStyle(n.row.income)},[e._v(e._s(e.formatNum(n.row.income)))])]}},{key:"table-column-expend",fn:function({scope:n}){return[t("div",{style:e.negStyle(n.row.expend)},[e._v(e._s(e.formatNum(n.row.expend)))])]}},{key:"table-column-profit",fn:function({scope:n}){return[t("div",{style:e.negStyle(n.row.profit)},[e._v(e._s(e.formatNum(n.row.profit)))])]}},{key:"table-column-saleNum",fn:function({scope:n}){return[t("div",{style:e.negStyle(n.row.saleNum)},[e._v(e._s(e.formatNum(n.row.saleNum)))])]}},{key:"table-column-cgNum",fn:function({scope:n}){return[t("div",{style:e.negStyle(n.row.cgNum)},[e._v(e._s(e.formatNum(n.row.cgNum)))])]}}])})],1)},s=[],o=n("5880"),r={data(){return{crud:null,pickerOptions:{shortcuts:[{text:"最近一周",onClick(e){const t=new Date,n=new Date;n.setTime(n.getTime()-6048e5),e.$emit("pick",[n,t])}},{text:"最近一个月",onClick(e){const t=new Date,n=new Date;n.setTime(n.getTime()-2592e6),e.$emit("pick",[n,t])}},{text:"最近三个月",onClick(e){const t=new Date,n=new Date;n.setTime(n.getTime()-7776e6),e.$emit("pick",[n,t])}}]},currentDateList:"",startTime:"",endTime:"",searchTime:"",totalAmount:0}},computed:{...Object(o["mapGetters"])(["shopInfo"])},methods:{formatNum(e){const t=parseFloat(e);return isNaN(t)?0:t},negStyle(e){const t=Number(e);return!isNaN(t)&&t<0?"color:#e74c3c;font-weight:bold;":""},queryParams(e){return{searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,...e||{}}},exportData(){this.$service.stat.getClassProfit(this.queryParams({export:1})).then(e=>{e.file&&(window.location.href=e.file)})},onLoad({ctx:e,app:t}){this.app=t,e.service({page:()=>this.$service.stat.getClassProfit(this.queryParams()).then(e=>{const t=this.formatNum(e.packFreight),n=this.formatNum(e.onlyRefundCg),a=this.formatNum(e.onlyRefund),s=this.formatNum(e.totalLabourCost),o=this.formatNum(e.totalDiscountAmount);let r=[...e.list||[],{className:"物流打包费",income:0,expend:t,profit:-t,saleNum:0,cgNum:0},{className:"采购仅退款",income:n,expend:0,profit:n,saleNum:0,cgNum:0},{className:"销售仅退款",income:0,expend:a,profit:-a,saleNum:0,cgNum:0},{className:"附加人工费",income:s,expend:0,profit:s,saleNum:0,cgNum:0},{className:"优惠金额",income:-o,expend:0,profit:-o,saleNum:0,cgNum:0},{className:"【汇总金额】",income:this.formatNum(e.totalIncome),expend:this.formatNum(e.totalExpend),profit:this.formatNum(e.totalProfit),saleNum:0,cgNum:0}];return{list:r}})}).set("table",{columns:[{label:"名称",prop:"className",align:"center"},{label:"销售数量",prop:"saleNum",align:"center"},{label:"销售收入",prop:"income",align:"center"},{label:"采购数量",prop:"cgNum",align:"center"},{label:"采购成本",prop:"expend",align:"center"},{label:"花材利润",prop:"profit",align:"center"}],op:{visible:!1,props:{width:250,align:"center",fixed:"right",label:"操作"},layout:[]}}).set("layout",[["slot-date-select","slot-export-due","flex1"],["data-table"],["slot-class-tip","flex1"]]).done(),t.refresh()},getDate(){this.searchTime="custom",this.startTime=this.currentDateList[0],this.endTime=this.currentDateList[1],this.app.refresh(this.queryParams())}}},i=r,l=(n("7443"),n("1805")),c=Object(l["a"])(i,a,s,!1,null,"fcf70bca",null);t["default"]=c.exports},f2ad:function(e,t,n){}}]);